Commit b3dda01d authored by Michal Suchanek's avatar Michal Suchanek Committed by Greg Kroah-Hartman
Browse files

debugfs: lockdown: Allow reading debugfs files that are not world readable

[ Upstream commit 358fcf5d ]

When the kernel is locked down the kernel allows reading only debugfs
files with mode 444. Mode 400 is also valid but is not allowed.

Make the 444 into a mask.

Fixes: 5496197f

 ("debugfs: Restrict debugfs when the kernel is locked down")
Signed-off-by: default avatarMichal Suchanek <msuchanek@suse.de>
Link: https://lore.kernel.org/r/20220104170505.10248-1-msuchanek@suse.de

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b9b5da3e
linux-5.10.y Tags unavailable
No related merge requests found
Showing with 1 addition and 1 deletion
+1 -1
......@@ -147,7 +147,7 @@ static int debugfs_locked_down(struct inode *inode,
struct file *filp,
const struct file_operations *real_fops)
{
if ((inode->i_mode & 07777) == 0444 &&
if ((inode->i_mode & 07777 & ~0444) == 0 &&
!(filp->f_mode & FMODE_WRITE) &&
!real_fops->unlocked_ioctl &&
!real_fops->compat_ioctl &&
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment