kernel_samsung_a53x/fs/notify
Amir Goldstein 35d955c598 fanotify: fix permission model of unprivileged group
[ Upstream commit a8b98c808eab3ec8f1b5a64be967b0f4af4cae43 ]

Reporting event->pid should depend on the privileges of the user that
initialized the group, not the privileges of the user reading the
events.

Use an internal group flag FANOTIFY_UNPRIV to record the fact that the
group was initialized by an unprivileged user.

To be on the safe side, the premissions to setup filesystem and mount
marks now require that both the user that initialized the group and
the user setting up the mark have CAP_SYS_ADMIN.

Link: https://lore.kernel.org/linux-fsdevel/CAOQ4uxiA77_P5vtv7e83g0+9d7B5W9ZTE4GfQEYbWmfT1rA=VA@mail.gmail.com/
Fixes: 7cea2a3c505e ("fanotify: support limited functionality for unprivileged users")
Cc: <Stable@vger.kernel.org> # v5.12+
Link: https://lore.kernel.org/r/20210524135321.2190062-1-amir73il@gmail.com
Reviewed-by: Matthew Bobrowski <repnop@google.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:37 +01:00
..
dnotify file: Rename fcheck lookup_fd_rcu 2024-11-19 12:27:27 +01:00
fanotify fanotify: fix permission model of unprivileged group 2024-11-19 12:27:37 +01:00
inotify fsnotify: use hash table for faster events merge 2024-11-19 12:27:36 +01:00
fdinfo.c fanotify: fix permission model of unprivileged group 2024-11-19 12:27:37 +01:00
fdinfo.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fsnotify.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fsnotify.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
group.c fanotify: configurable limits via sysfs 2024-11-19 12:27:37 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mark.c fanotify: configurable limits via sysfs 2024-11-19 12:27:37 +01:00
notification.c fsnotify: use hash table for faster events merge 2024-11-19 12:27:36 +01:00