summaryrefslogtreecommitdiff
path: root/fs/notify
diff options
context:
space:
mode:
authorChristian Brauner <christian.brauner@ubuntu.com>2021-03-25 09:37:43 +0100
committerJan Kara <jack@suse.cz>2021-03-25 15:33:45 +0100
commit22d483b99863202e3631ff66fa0f3c2302c0f96f (patch)
tree517f550b13521af5c20556eb32fbd188eb64b437 /fs/notify
parent7cea2a3c505e87a9d6afc78be4a7f7be636a73a7 (diff)
downloadlwn-22d483b99863202e3631ff66fa0f3c2302c0f96f.tar.gz
lwn-22d483b99863202e3631ff66fa0f3c2302c0f96f.zip
fanotify_user: use upper_32_bits() to verify mask
I don't see an obvious reason why the upper 32 bit check needs to be open-coded this way. Switch to upper_32_bits() which is more idiomatic and should conceptually be the same check. Cc: Amir Goldstein <amir73il@gmail.com> Cc: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20210325083742.2334933-1-brauner@kernel.org Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/notify')
-rw-r--r--fs/notify/fanotify/fanotify_user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 65142b1fa823..71fefb30e015 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -1250,7 +1250,7 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
__func__, fanotify_fd, flags, dfd, pathname, mask);
/* we only use the lower 32 bits as of right now. */
- if (mask & ((__u64)0xffffffff << 32))
+ if (upper_32_bits(mask))
return -EINVAL;
if (flags & ~FANOTIFY_MARK_FLAGS)