qemu/nbd
Eric Blake 260e34dbb7 nbd/client: Correctly handle bad server REP_META_CONTEXT
It's never a good idea to blindly read for size bytes as
returned by the server without first validating that the size
is within bounds; a malicious or buggy server could cause us
to hang or get out of sync from reading further messages.

It may be smarter to try and teach the client to cope with
unexpected context ids by silently ignoring them instead of
hanging up on the server, but for now, if the server doesn't
reply with exactly the one context we expect, it's easier to
just give up - however, if we give up for any reason other
than an I/O failure, we might as well try to politely tell
the server we are quitting rather than continuing.

Fix some typos in the process.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180329231837.1914680-1-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
2018-04-02 08:59:34 -05:00
..
client.c nbd/client: Correctly handle bad server REP_META_CONTEXT 2018-04-02 08:59:34 -05:00
common.c nbd: BLOCK_STATUS constants 2018-03-01 14:05:24 -06:00
Makefile.objs
nbd-internal.h nbd: Minimal structured read for client 2017-10-30 21:48:41 +01:00
server.c nbd: BLOCK_STATUS for standard get_block_status function: server part 2018-03-13 15:38:56 -05:00
trace-events nbd/client: fix error messages in nbd_handle_reply_err 2018-03-01 14:48:23 -06:00