diff options
author | Amir Goldstein <amir73il@gmail.com> | 2023-12-12 10:44:40 +0100 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2023-12-12 16:20:02 +0100 |
commit | d9e5d31084b024734e64307521414ef0ae1d5333 (patch) | |
tree | 5cad647473aa9eba5963c8d8caa7cf7dac635200 /security/security.c | |
parent | fsnotify: assert that file_start_write() is not held in permission hooks (diff) | |
download | linux-d9e5d31084b024734e64307521414ef0ae1d5333.tar.xz linux-d9e5d31084b024734e64307521414ef0ae1d5333.zip |
fsnotify: optionally pass access range in file permission hooks
In preparation for pre-content permission events with file access range,
move fsnotify_file_perm() hook out of security_file_permission() and into
the callers.
Callers that have the access range information call the new hook
fsnotify_file_area_perm() with the access range.
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/r/20231212094440.250945-6-amir73il@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'security/security.c')
-rw-r--r-- | security/security.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/security/security.c b/security/security.c index d7f3703c5905..2a7fc7881cbc 100644 --- a/security/security.c +++ b/security/security.c @@ -2580,13 +2580,7 @@ int security_kernfs_init_security(struct kernfs_node *kn_dir, */ int security_file_permission(struct file *file, int mask) { - int ret; - - ret = call_int_hook(file_permission, 0, file, mask); - if (ret) - return ret; - - return fsnotify_file_perm(file, mask); + return call_int_hook(file_permission, 0, file, mask); } /** |