From d1832e648d2be564e4b5e357f94d0f33156590dc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 27 May 2025 22:39:51 -0400 Subject: landlock: opened file never has a negative dentry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Christian Brauner Acked-by: Mickaël Salaün Signed-off-by: Al Viro --- security/landlock/syscalls.c | 1 - 1 file changed, 1 deletion(-) (limited to 'security') diff --git a/security/landlock/syscalls.c b/security/landlock/syscalls.c index 33eafb71e4f3..0116e9f93ffe 100644 --- a/security/landlock/syscalls.c +++ b/security/landlock/syscalls.c @@ -303,7 +303,6 @@ static int get_path_from_fd(const s32 fd, struct path *const path) if ((fd_file(f)->f_op == &ruleset_fops) || (fd_file(f)->f_path.mnt->mnt_flags & MNT_INTERNAL) || (fd_file(f)->f_path.dentry->d_sb->s_flags & SB_NOUSER) || - d_is_negative(fd_file(f)->f_path.dentry) || IS_PRIVATE(d_backing_inode(fd_file(f)->f_path.dentry))) return -EBADFD; -- cgit v1.2.3 From 273a291dd7e62c42ee315777477dade0ede6636e Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 27 May 2025 23:03:43 -0400 Subject: apparmor: file never has NULL f_path.mnt Reviewed-by: Christian Brauner Signed-off-by: Al Viro --- security/apparmor/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'security') diff --git a/security/apparmor/file.c b/security/apparmor/file.c index d52a5b14dad4..f494217112c9 100644 --- a/security/apparmor/file.c +++ b/security/apparmor/file.c @@ -604,7 +604,7 @@ int aa_file_perm(const char *op, const struct cred *subj_cred, rcu_read_unlock(); /* TODO: label cross check */ - if (file->f_path.mnt && path_mediated_fs(file->f_path.dentry)) + if (path_mediated_fs(file->f_path.dentry)) error = __file_path_perm(op, subj_cred, label, flabel, file, request, denied, in_atomic); -- cgit v1.2.3