qemu-e2k/include
Eric Blake 93676c88d7 nbd: Don't send oversize strings
Qemu as server currently won't accept export names larger than 256
bytes, nor create dirty bitmap names longer than 1023 bytes, so most
uses of qemu as client or server have no reason to get anywhere near
the NBD spec maximum of a 4k limit per string.

However, we weren't actually enforcing things, ignoring when the
remote side violates the protocol on input, and also having several
code paths where we send oversize strings on output (for example,
qemu-nbd --description could easily send more than 4k).  Tighten
things up as follows:

client:
- Perform bounds check on export name and dirty bitmap request prior
  to handing it to server
- Validate that copied server replies are not too long (ignoring
  NBD_INFO_* replies that are not copied is not too bad)
server:
- Perform bounds check on export name and description prior to
  advertising it to client
- Reject client name or metadata query that is too long
- Adjust things to allow full 4k name limit rather than previous
  256 byte limit

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20191114024635.11363-4-eblake@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
2019-11-18 16:01:34 -06:00
..
authz
block nbd: Don't send oversize strings 2019-11-18 16:01:34 -06:00
chardev
crypto
disas
exec TCG Plugins initial implementation 2019-10-30 14:10:32 +00:00
fpu
hw ppc patch queue 2019-11-15 2019-11-18 11:09:06 +00:00
io
libdecnumber
migration migration: add new migration state wait-unplug 2019-10-29 18:55:26 -04:00
monitor
net
qapi
qemu tcg plugins: expose an API version concept 2019-11-12 14:32:55 +00:00
qom
scsi
standard-headers
sysemu bootdevice: FW_CFG interface for LCHS values 2019-10-31 11:47:38 -04:00
ui
user
elf.h
glib-compat.h
qemu-common.h
qemu-io.h
trace-tcg.h