fsnotify: compile out fsnotify permission hooks if !FANOTIFY_ACCESS_PERMISSIONS
authorAmir Goldstein <amir73il@gmail.com>
Tue, 9 Jan 2024 18:22:45 +0000 (20:22 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 12 Jan 2024 14:34:50 +0000 (15:34 +0100)
commit7ea26f9460c6c76b1d6e36f39fce34b16cb88300
tree0e738d825c25ccc6a032d786b0229feefaac132c
parent70d201a40823acba23899342d62bc2644051ad2e
fsnotify: compile out fsnotify permission hooks if !FANOTIFY_ACCESS_PERMISSIONS

The depency of FANOTIFY_ACCESS_PERMISSIONS on SECURITY made sure that
the fsnotify permission hooks were never called when SECURITY was
disabled.

Moving the fsnotify permission hook out of the secutiy hook broke that
optimisation.

Reported-and-tested-by: Jens Axboe <axboe@kernel.dk>
Closes: https://lore.kernel.org/linux-fsdevel/53682ece-f0e7-48de-9a1c-879ee34b0449@kernel.dk/
Fixes: d9e5d31084b0 ("fsnotify: optionally pass access range in file permission hooks")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/r/20240109182245.38884-1-amir73il@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/fsnotify.h