diff options
author | Song Liu <song@kernel.org> | 2024-10-13 02:22:48 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2024-10-14 17:38:27 +0200 |
commit | 1cda52f1b4611f4daa9d89e69d9428fb4137dc3f (patch) | |
tree | f852c5ac8fefb8da87e20fd155c23a76e7ec68e2 /security | |
parent | Merge tag 'hid-for-linus-2024101301' of git://git.kernel.org/pub/scm/linux/ke... (diff) | |
download | linux-1cda52f1b4611f4daa9d89e69d9428fb4137dc3f.tar.xz linux-1cda52f1b4611f4daa9d89e69d9428fb4137dc3f.zip |
fsnotify, lsm: Decouple fsnotify from lsm
Currently, fsnotify_open_perm() is called from security_file_open().
This is a a bit unexpected and creates otherwise unnecessary dependency
of CONFIG_FANOTIFY_ACCESS_PERMISSIONS on CONFIG_SECURITY. Fix this by
calling fsnotify_open_perm() directly.
Signed-off-by: Song Liu <song@kernel.org>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20241013002248.3984442-1-song@kernel.org
Diffstat (limited to 'security')
-rw-r--r-- | security/security.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/security/security.c b/security/security.c index c5981e558bc2..19e87a159303 100644 --- a/security/security.c +++ b/security/security.c @@ -19,7 +19,6 @@ #include <linux/kernel.h> #include <linux/kernel_read_file.h> #include <linux/lsm_hooks.h> -#include <linux/fsnotify.h> #include <linux/mman.h> #include <linux/mount.h> #include <linux/personality.h> @@ -3104,13 +3103,7 @@ int security_file_receive(struct file *file) */ int security_file_open(struct file *file) { - int ret; - - ret = call_int_hook(file_open, file); - if (ret) - return ret; - - return fsnotify_open_perm(file); + return call_int_hook(file_open, file); } /** |