diff options
author | 2019-03-13 09:34:35 -0700 | |
---|---|---|
committer | 2019-03-13 09:34:35 -0700 | |
commit | a840b56ba385059742c2b7f4fd665ec9afb8931e (patch) | |
tree | 206f6bec3347f7b7634aeea24dee43ec366df860 /fs/ubifs/ioctl.c | |
parent | Merge tag 'nfsd-5.1' of git://linux-nfs.org/~bfields/linux (diff) | |
parent | ubi: wl: Silence uninitialized variable warning (diff) | |
download | linux-a840b56ba385059742c2b7f4fd665ec9afb8931e.tar.gz linux-a840b56ba385059742c2b7f4fd665ec9afb8931e.tar.bz2 linux-a840b56ba385059742c2b7f4fd665ec9afb8931e.zip |
Merge tag 'upstream-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs
Pull UBI and UBIFS updates from Richard Weinberger:
- A new interface for UBI to deal better with read disturb
- Reject unsupported ioctl flags in UBIFS (xfstests found it)
* tag 'upstream-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
ubi: wl: Silence uninitialized variable warning
ubifs: Reject unsupported ioctl flags explicitly
ubi: Expose the bitrot interface
ubi: Introduce in_pq()
Diffstat (limited to 'fs/ubifs/ioctl.c')
-rw-r--r-- | fs/ubifs/ioctl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c index 0f9c362a3402..82e4e6a30b04 100644 --- a/fs/ubifs/ioctl.c +++ b/fs/ubifs/ioctl.c @@ -28,6 +28,11 @@ #include <linux/mount.h> #include "ubifs.h" +/* Need to be kept consistent with checked flags in ioctl2ubifs() */ +#define UBIFS_SUPPORTED_IOCTL_FLAGS \ + (FS_COMPR_FL | FS_SYNC_FL | FS_APPEND_FL | \ + FS_IMMUTABLE_FL | FS_DIRSYNC_FL) + /** * ubifs_set_inode_flags - set VFS inode flags. * @inode: VFS inode to set flags for @@ -169,6 +174,9 @@ long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (get_user(flags, (int __user *) arg)) return -EFAULT; + if (flags & ~UBIFS_SUPPORTED_IOCTL_FLAGS) + return -EOPNOTSUPP; + if (!S_ISDIR(inode->i_mode)) flags &= ~FS_DIRSYNC_FL; |