summaryrefslogtreecommitdiffstats
path: root/module/zfs/zpl_file.c
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2016-12-16 12:41:56 -0800
committerChunwei Chen <[email protected]>2016-12-16 12:46:46 -0800
commitc360af541117a0978b7fe146b59c12ad2f80d162 (patch)
tree2a1e6216ba97a7e88d39071d3c45c3cbf57fcaa4 /module/zfs/zpl_file.c
parent05100ec8f06589896fcd2a847a12c5b6fcb67b81 (diff)
Fix fchange in zpl_ioctl_setflags
The fchange in zpl_ioctl_setflags was for detecting flag change. However it was incorrect and would always fail to detect a flag change from set to unset, causing users without CAP_LINUX_IMMUTABLE to be able to unset flags. Signed-off-by: Chunwei Chen <[email protected]>
Diffstat (limited to 'module/zfs/zpl_file.c')
-rw-r--r--module/zfs/zpl_file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c
index a22522028..332fb992e 100644
--- a/module/zfs/zpl_file.c
+++ b/module/zfs/zpl_file.c
@@ -737,8 +737,7 @@ zpl_ioctl_getflags(struct file *filp, void __user *arg)
* is outside of our jurisdiction.
*/
-#define fchange(f0, f1, b0, b1) ((((f0) & (b0)) == (b0)) != \
- (((b1) & (f1)) == (f1)))
+#define fchange(f0, f1, b0, b1) (!((f0) & (b0)) != !((f1) & (b1)))
static int
zpl_ioctl_setflags(struct file *filp, void __user *arg)