]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fanotify: call fanotify_events_supported() before path_permission() and security_path...
authorOndrej Mosnacek <omosnace@redhat.com>
Mon, 16 Feb 2026 15:06:25 +0000 (16:06 +0100)
committerJan Kara <jack@suse.cz>
Thu, 26 Feb 2026 14:18:41 +0000 (15:18 +0100)
commit66052a768d4726a31e939b5ac902f2b0b452c8d5
tree0a2045116eed153d95d151e76010c4373f241094
parent0d5ee3373426395478c355f3e93ba4b1118a04e9
fanotify: call fanotify_events_supported() before path_permission() and security_path_notify()

The latter trigger LSM (e.g. SELinux) checks, which will log a denial
when permission is denied, so it's better to do them after validity
checks to avoid logging a denial when the operation would fail anyway.

Fixes: 0b3b094ac9a7 ("fanotify: Disallow permission events for proc filesystem")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Paul Moore <paul@paul-moore.com>
Link: https://patch.msgid.link/20260216150625.793013-3-omosnace@redhat.com
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/fanotify/fanotify_user.c