Skip to content

Commit

Permalink
fuse: reserve byteswapped init opcodes
Browse files Browse the repository at this point in the history
virtio fs tunnels fuse over a virtio channel.  One issue is two sides might
be speaking different endian-ness. To detects this, host side looks at the
opcode value in the FUSE_INIT command.  Works fine at the moment but might
fail if a future version of fuse will use such an opcode for
initialization.  Let's reserve this opcode so we remember and don't do
this.

Same for CUSE_INIT.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
  • Loading branch information
Michael S. Tsirkin authored and Miklos Szeredi committed Sep 12, 2019
1 parent 15c8e72 commit 501ae8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/uapi/linux/fuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ enum fuse_opcode {

/* CUSE specific operations */
CUSE_INIT = 4096,

/* Reserved opcodes: helpful to detect structure endian-ness */
CUSE_INIT_BSWAP_RESERVED = 1048576, /* CUSE_INIT << 8 */
FUSE_INIT_BSWAP_RESERVED = 436207616, /* FUSE_INIT << 24 */
};

enum fuse_notify_code {
Expand Down

0 comments on commit 501ae8e

Please sign in to comment.