mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-05 00:07:48 -04:00
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user