Skip to content

Commit 22d483b

Browse files
Christian Braunerjankara
authored andcommitted
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 <[email protected]> Cc: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent 7cea2a3 commit 22d483b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/notify/fanotify/fanotify_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
12501250
__func__, fanotify_fd, flags, dfd, pathname, mask);
12511251

12521252
/* we only use the lower 32 bits as of right now. */
1253-
if (mask & ((__u64)0xffffffff << 32))
1253+
if (upper_32_bits(mask))
12541254
return -EINVAL;
12551255

12561256
if (flags & ~FANOTIFY_MARK_FLAGS)

0 commit comments

Comments
 (0)