]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fanotify: fix false positive on permission events
authorMiklos Szeredi <mszeredi@redhat.com>
Fri, 10 Apr 2026 14:49:47 +0000 (16:49 +0200)
committerJan Kara <jack@suse.cz>
Thu, 16 Apr 2026 11:31:04 +0000 (13:31 +0200)
commit7746e3bd4cc19b5092e00d32d676e329bfcb6900
tree24ef14a73886f092021bf23c8b13eb1a15d7e8c1
parent1d51b370a0f8f642f4fc84c795fbedac0fcdbbd2
fanotify: fix false positive on permission events

fsnotify_get_mark_safe() may return false for a mark on an unrelated group,
which results in bypassing the permission check.

Fix by skipping over detached marks that are not in the current group.

CC: stable@vger.kernel.org
Fixes: abc77577a669 ("fsnotify: Provide framework for dropping SRCU lock in ->handle_event")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Link: https://patch.msgid.link/20260410144950.156160-1-mszeredi@redhat.com
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/fsnotify.c
fs/notify/mark.c
include/linux/fsnotify_backend.h