History

fuse: Add ioctl flag for x32 compat ioctl

Currently, a CUSE server running on a 64-bit kernel can tell when an ioctl request comes from a process running a 32-bit ABI, but cannot tell whether the requesting process is using legacy IA32 emulation or x32 ABI. In particular, the server does not know the size of the client process's `time_t` type. For 64-bit kernels, the `FUSE_IOCTL_COMPAT` and `FUSE_IOCTL_32BIT` flags are currently set in the ioctl input request (`struct fuse_ioctl_in` member `flags`) for a 32-bit requesting process. This patch defines a new flag `FUSE_IOCTL_COMPAT_X32` and sets it if the 32-bit requesting process is using the x32 ABI. This allows the server process to distinguish between requests coming from client processes using IA32 emulation or the x32 ABI and so infer the size of the client process's `time_t` type and any other IA32/x32 differences.

Ian Abbott committed 7 years ago

Commit 6407f441 parent 29cc02d2 files · +9 −1Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/fuse.h+3−0
@@ -129,6 +129,7 @@ · 128 unmodified lines
129129 *
130130 * 7.30
131131 * - add FUSE_EXPLICIT_INVAL_DATA
132+ * - add FUSE_IOCTL_COMPAT_X32
132133 */
133134
134135 #ifndef _LINUX_FUSE_H
@@ -343,6 +344,7 @@ struct fuse_file_lock { · 208 unmodified lines
343344 * FUSE_IOCTL_RETRY: retry with new iovecs
344345 * FUSE_IOCTL_32BIT: 32bit ioctl
345346 * FUSE_IOCTL_DIR: is a directory
347+ * FUSE_IOCTL_COMPAT_X32: x32 compat ioctl on 64bit machine (64bit time_t)
346348 *
347349 * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs
348350 */
@@ -351,6 +353,7 @@ struct fuse_file_lock { · 2 unmodified lines
351353 #define FUSE_IOCTL_RETRY (1 << 2)
352354 #define FUSE_IOCTL_32BIT (1 << 3)
353355 #define FUSE_IOCTL_DIR (1 << 4)
356+#define FUSE_IOCTL_COMPAT_X32 (1 << 5)
354357
355358 #define FUSE_IOCTL_MAX_IOV 256
356359