[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190910151206.4671-2-mszeredi@redhat.com>
Date: Tue, 10 Sep 2019 17:12:03 +0200
From: Miklos Szeredi <mszeredi@...hat.com>
To: virtualization@...ts.linux-foundation.org,
linux-fsdevel@...r.kernel.org
Cc: "Michael S. Tsirkin" <mst@...hat.com>,
linux-kernel@...r.kernel.org,
Stefan Hajnoczi <stefanha@...hat.com>,
Vivek Goyal <vgoyal@...hat.com>,
"Dr. David Alan Gilbert" <dgilbert@...hat.com>
Subject: [PATCH v5 1/4] fuse: reserve byteswapped init opcodes
From: "Michael S. Tsirkin" <mst@...hat.com>
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@...hat.com>
Signed-off-by: Miklos Szeredi <mszeredi@...hat.com>
---
include/uapi/linux/fuse.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
index 2971d29a42e4..df2e12fb3381 100644
--- a/include/uapi/linux/fuse.h
+++ b/include/uapi/linux/fuse.h
@@ -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 {
--
2.21.0
Powered by blists - more mailing lists