Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Christian Brauner and committed by
Jan Kara
22d483b9 7cea2a3c

+1 -1
+1 -1
fs/notify/fanotify/fanotify_user.c
··· 1250 1250 __func__, fanotify_fd, flags, dfd, pathname, mask); 1251 1251 1252 1252 /* we only use the lower 32 bits as of right now. */ 1253 - if (mask & ((__u64)0xffffffff << 32)) 1253 + if (upper_32_bits(mask)) 1254 1254 return -EINVAL; 1255 1255 1256 1256 if (flags & ~FANOTIFY_MARK_FLAGS)