]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
nsfs: fix ioctl declaration
authorChristian Brauner <brauner@kernel.org>
Wed, 31 Jul 2024 05:47:27 +0000 (07:47 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 12 Aug 2024 20:03:26 +0000 (22:03 +0200)
The kernel is writing an object of type __u64, so the ioctl has to be
defined to _IOR(NSIO, 0x5, __u64) instead of _IO(NSIO, 0x5).

Reported-by: Dmitry V. Levin <ldv@strace.io>
Link: https://lore.kernel.org/r/20240730164554.GA18486@altlinux.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/uapi/linux/nsfs.h

index b133211331f6a60e57e46f7c6bff650dc7d3c637..5fad3d0fcd70788de7c7cb67d4175c43574f0191 100644 (file)
@@ -3,6 +3,7 @@
 #define __LINUX_NSFS_H
 
 #include <linux/ioctl.h>
+#include <linux/types.h>
 
 #define NSIO   0xb7
 
@@ -16,7 +17,7 @@
 /* Get owner UID (in the caller's user namespace) for a user namespace */
 #define NS_GET_OWNER_UID       _IO(NSIO, 0x4)
 /* Get the id for a mount namespace */
-#define NS_GET_MNTNS_ID                _IO(NSIO, 0x5)
+#define NS_GET_MNTNS_ID                _IOR(NSIO, 0x5, __u64)
 /* Translate pid from target pid namespace into the caller's pid namespace. */
 #define NS_GET_PID_FROM_PIDNS  _IOR(NSIO, 0x6, int)
 /* Return thread-group leader id of pid in the callers pid namespace. */