debugfs: lockdown: Allow reading debugfs files that are not world readable
authorMichal Suchanek <msuchanek@suse.de>
Tue, 4 Jan 2022 17:05:05 +0000 (18:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:03:55 +0000 (11:03 +0100)
commit1850a403bd0b9b61dffcf6afa2fefe6db9a49fd4
treeb614347782ce9056daf1aa8fbeaf24559f09725f
parent0fc97f944245de471cbabf637fd84036939e009a
debugfs: lockdown: Allow reading debugfs files that are not world readable

[ Upstream commit 358fcf5ddbec4e6706405847d6a666f5933a6c25 ]

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: 5496197f9b08 ("debugfs: Restrict debugfs when the kernel is locked down")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Link: https://lore.kernel.org/r/20220104170505.10248-1-msuchanek@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/debugfs/file.c