Skip to contentSkip to conversation

NBD patches for 2019-09-24

GIT PULL Applied Eric Blake 2 participants 3 messages Sep 25, 2019 – Sep 26, 2019

lore
Share & tools
lore

Eric Blake

author
#0 lore raw

The following changes since commit 2f93a3ecdd3bb060bd04f698ccafe66efd98563a:

Merge remote-tracking branch 'remotes/davidhildenbrand/tags/s390x-tcg-2019-09-23' into staging (2019-09-23 15:44:52 +0100)

are available in the Git repository at:

https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2019-09-24-v2

for you to fetch changes up to da5e1169183ca6eb6fb470dc32ed1bfc24d1d406:

util/qemu-sockets: fix keep_alive handling in inet_connect_saddr (2019-09-25 08:15:44 -0500)

For v2 - add one more patch

----------------------------------------------------------------
nbd patches for 2019-09-24

- Improved error message for plaintext client of encrypted server
- Fix various assertions when -object iothread is in use
- Silence a Coverity error for use-after-free on error path

----------------------------------------------------------------
Eric Blake (3):
nbd/client: Add hint when TLS is missing
nbd: Grab aio context lock in more places
tests: Use iothreads during iotest 223

Sergio Lopez (1):
nbd/server: attach client channel to the export's AioContext

Vladimir Sementsov-Ogievskiy (1):
util/qemu-sockets: fix keep_alive handling in inet_connect_saddr

 include/block/nbd.h        |  1 +
 blockdev-nbd.c             | 14 ++++++++++++--
 nbd/client.c               |  1 +
 nbd/server.c               | 27 +++++++++++++++++++++++----
 util/qemu-sockets.c        |  5 +++--
 tests/qemu-iotests/223     |  6 ++++--
 tests/qemu-iotests/223.out |  1 +
 tests/qemu-iotests/233.out |  2 ++
 8 files changed, 47 insertions(+), 10 deletions(-)
Signature · 1 line
2.21.0
author
#1 lore raw

[PULL v2 5/5] util/qemu-sockets: fix keep_alive handling in inet_connect_saddr

From: Vladimir Sementsov-Ogievskiy <[email protected]>

In "if (saddr->keep_alive) {" we may already be on error path, with invalid sock < 0. Fix it by returning error earlier.

Reported-by Coverity (CID 1405300)
Fixes aec21d31756cbd

Message-Id: <[email protected]>

---
 util/qemu-sockets.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
util/qemu-sockets.c +3 -2
index 98ff3a1cce64..bcc06d0e01c7 100644
@@ -461,12 +461,13 @@ int inet_connect_saddr(InetSocketAddress *saddr, Error **errp)
         }
     }
 
+    freeaddrinfo(res);
+
     if (sock < 0) {
         error_propagate(errp, local_err);
+        return sock;
     }
 
-    freeaddrinfo(res);
-
     if (saddr->keep_alive) {
         int val = 1;
         int ret = qemu_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE,
Signature · 1 line
2.21.0
#2 lore raw
In reply to Eric Blake
Quoted 13 lines · Eric Blake

The following changes since commit 2f93a3ecdd3bb060bd04f698ccafe66efd98563a:

Merge remote-tracking branch 'remotes/davidhildenbrand/tags/s390x-tcg-2019-09-23' into staging (2019-09-23 15:44:52 +0100)

are available in the Git repository at:

https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2019-09-24-v2

for you to fetch changes up to da5e1169183ca6eb6fb470dc32ed1bfc24d1d406:

util/qemu-sockets: fix keep_alive handling in inet_connect_saddr (2019-09-25 08:15:44 -0500)

Quoted 9 lines

For v2 - add one more patch

----------------------------------------------------------------
nbd patches for 2019-09-24

- Improved error message for plaintext client of encrypted server
- Fix various assertions when -object iothread is in use
- Silence a Coverity error for use-after-free on error path

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.2
for any user-visible changes.

-- PMM