From: Al Viro Date: Wed, 28 May 2025 02:39:51 +0000 (-0400) Subject: landlock: opened file never has a negative dentry X-Git-Tag: block-6.17-20250808~66^2~4 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=d1832e648d2be564e4b5e357f94d0f33156590dc;p=linux-block.git landlock: opened file never has a negative dentry Reviewed-by: Christian Brauner Acked-by: Mickaël Salaün Signed-off-by: Al Viro --- 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;