linux/fs/notify
Miklos Szeredi 4a7611ad65 fanotify: fix false positive on permission events
commit 7746e3bd4c upstream.

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: abc77577a6 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-06-01 17:35:21 +02:00
..
dnotify dnotify: use fsnotify group lock helpers 2024-04-10 16:19:03 +02:00
fanotify fanotify: Remove obsoleted fanotify_event_has_path() 2024-04-10 16:19:19 +02:00
inotify inotify: fix watch count leak when fsnotify_add_inode_mark_locked() fails 2026-06-01 17:35:17 +02:00
fdinfo.c fanotify: prepare for setting event flags in ignore mask 2024-04-10 16:19:07 +02:00
fdinfo.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fsnotify.c fanotify: fix false positive on permission events 2026-06-01 17:35:21 +02:00
fsnotify.h fsnotify: clear PARENT_WATCHED flags lazily 2024-09-12 11:07:41 +02:00
group.c fsnotify: create helpers for group mark_mutex lock 2024-04-10 16:19:03 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mark.c fanotify: fix false positive on permission events 2026-06-01 17:35:21 +02:00
notification.c fsnotify: Pass group argument to free_event 2024-04-10 16:18:50 +02:00