[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/15] nbd: Don't kill server when client requests un
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 09/15] nbd: Don't kill server when client requests unknown option |
Date: |
Thu, 7 Apr 2016 18:50:39 +0200 |
From: Eric Blake <address@hidden>
nbd-server.c currently fails to handle unsupported options properly.
If during option haggling the client sends an unknown request, the
server kills the connection instead of letting the client try to
fall back to something older. This is precisely what advertising
NBD_FLAG_FIXED_NEWSTYLE was supposed to fix.
Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
nbd/server.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/nbd/server.c b/nbd/server.c
index 6d9c15a..2a4dd10 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -483,9 +483,12 @@ static int nbd_negotiate_options(NBDClient *client)
return -EINVAL;
default:
TRACE("Unsupported option 0x%x", clientflags);
+ if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
+ return -EIO;
+ }
nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_UNSUP,
clientflags);
- return -EINVAL;
+ break;
}
} else {
/*
--
2.5.5
- [Qemu-devel] [PULL 00/15] Misc patches for QEMU 2.6.0-rc2, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 01/15] ps2kbd: default to scancode_set 2, as with KBD_CMD_RESET, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 02/15] hw/timer: Revert "hpet: inverse polarity when pin above ISA_NUM_IRQS", Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 03/15] docs: fix typo in memory.txt, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 04/15] nbd: Return correct error for write to read-only export, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 05/15] nbd: Avoid bitrot in TRACE() usage, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 06/15] nbd: Improve debug traces on little-endian, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 07/15] qemu-nbd: Document -x option, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 08/15] nbd: Fix NBD unsupported options, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 09/15] nbd: Don't kill server when client requests unknown option,
Paolo Bonzini <=
- [Qemu-devel] [PULL 10/15] nbd: do not hang nbd_wr_syncv if outside a coroutine and no available data, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 11/15] spapr: fix possible Negative array index read, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 13/15] translate-all: add missing fold of tb_ctx into tcg_ctx, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 12/15] hostmem-file: fix memory leak, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 14/15] tests: ignore test-logging, Paolo Bonzini, 2016/04/07
- [Qemu-devel] [PULL 15/15] target-i386: check for PKU even for non-writable pages, Paolo Bonzini, 2016/04/07