qemu-patch-raspberry4/hw/9pfs
Greg Kurz a4d9985450 virtio-9p: message header is 7-byte long
The 9p spec at http://man.cat-v.org/plan_9/5/intro reads:

 "Each 9P message begins with a four-byte size field specify-
  ing the length in bytes of the complete message including
  the four bytes of the size field itself.  The next byte is
  the message type, one of the constants in the enumeration in
  the include file <fcall.h>.  The next two bytes are an iden-
  tifying tag, described below."

ie, each message starts with a 7-byte long header.

The core 9P code already assumes this pretty much everywhere. This patch
does the following:
- makes the assumption explicit in the common 9p.h header, since it isn't
  related to the transport
- open codes the header size in handle_9p_output() and hardens the sanity
  check on the space needed for the reply message

Signed-off-by: Greg Kurz <groug@kaod.org>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2017-06-29 15:11:50 +02:00
..
9p-handle.c 9pfs: assume utimensat() and futimens() are present 2017-05-25 10:30:14 +02:00
9p-local.c 9pfs: local: Add support for custom fmode/dmode in 9ps mapped security modes 2017-06-29 15:11:50 +02:00
9p-local.h 9pfs: local: open/opendir: don't follow symlinks 2017-02-28 11:21:15 +01:00
9p-posix-acl.c 9pfs: local: lremovexattr: don't follow symlinks 2017-02-28 11:21:15 +01:00
9p-proxy.c 9pfs: proxy: assert if unmarshal fails 2017-03-21 09:12:47 +01:00
9p-proxy.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
9p-synth.c 9pfs: replace g_malloc()+memcpy() with g_memdup() 2017-06-29 15:11:50 +02:00
9p-synth.h 9pfs: fsdev: drop useless extern annotation for functions 2016-10-17 14:13:58 +02:00
9p-util.c 9pfs: local: simplify file opening 2017-05-25 10:30:14 +02:00
9p-util.h 9pfs: local: simplify file opening 2017-05-25 10:30:14 +02:00
9p-xattr-user.c 9pfs: local: lremovexattr: don't follow symlinks 2017-02-28 11:21:15 +01:00
9p-xattr.c 9pfs: xattr: fix memory leak in v9fs_list_xattr 2017-04-10 09:38:05 +02:00
9p-xattr.h 9pfs: local: lremovexattr: don't follow symlinks 2017-02-28 11:21:15 +01:00
9p.c 9pfs: local: Add support for custom fmode/dmode in 9ps mapped security modes 2017-06-29 15:11:50 +02:00
9p.h virtio-9p: message header is 7-byte long 2017-06-29 15:11:50 +02:00
codir.c 9pfs: use coroutine_fn annotation in hw/9pfs/co*.[ch] 2016-10-17 14:13:58 +02:00
cofile.c fsdev: add IO throttle support to fsdev devices 2017-02-28 10:31:46 +01:00
cofs.c 9pfs: use coroutine_fn annotation in hw/9pfs/co*.[ch] 2016-10-17 14:13:58 +02:00
coth.c coroutine: move entry argument to qemu_coroutine_create 2016-07-13 13:26:02 +02:00
coth.h 9pfs: use coroutine_fn annotation in hw/9pfs/co*.[ch] 2016-10-17 14:13:58 +02:00
coxattr.c 9pfs: use coroutine_fn annotation in hw/9pfs/co*.[ch] 2016-10-17 14:13:58 +02:00
Makefile.objs xen/9pfs: build and register Xen 9pfs backend 2017-04-25 11:04:33 -07:00
trace-events 9pfs: limit xattr size in xattrcreate 2016-11-01 12:03:02 +01:00
virtio-9p-device.c virtio-9p: message header is 7-byte long 2017-06-29 15:11:50 +02:00
virtio-9p.h 9pfs: introduce transport specific callbacks 2017-01-03 17:28:44 +01:00
xen-9p-backend.c virtio-9p/xen-9p: move 9p specific bits to core 9p code 2017-05-25 10:30:13 +02:00
xen-9pfs.h xen/9pfs: introduce Xen 9pfs backend 2017-04-25 11:04:28 -07:00