Skip to content

Commit 1cb925c

Browse files
t-8chAl Viro
authored andcommitted
nsfs: add compat ioctl handler
As all parameters and return values of the ioctls have the same representation on both 32bit and 64bit we can reuse the normal ioctl handler for the compat handler via compat_ptr_ioctl(). All nsfs ioctls return a plain "int" filedescriptor which is a signed 4-byte integer type on both 32bit and 64bit. The only parameter taken is by NS_GET_OWNER_UID and is a pointer to a "uid_t" which is a 4-byte unsigned integer type on both 32bit and 64bit. Fixes: 6786741 ("nsfs: add ioctl to get an owning user namespace for ns file descriptor") Reported-by: Karel Zak <[email protected]> Link: util-linux/util-linux#1924 (comment) Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent f27c942 commit 1cb925c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/nsfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ static long ns_ioctl(struct file *filp, unsigned int ioctl,
2121
static const struct file_operations ns_file_operations = {
2222
.llseek = no_llseek,
2323
.unlocked_ioctl = ns_ioctl,
24+
.compat_ioctl = compat_ptr_ioctl,
2425
};
2526

2627
static char *ns_dname(struct dentry *dentry, char *buffer, int buflen)

0 commit comments

Comments
 (0)