mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 18:12:48 +00:00
When (ia->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID)) is zero, then the SELinux implementation of the locked_down hook might report a denial even though the operation would actually be allowed. To fix this, make sure that security_locked_down() is called only when the return value will be taken into account (i.e. when changing one of the problematic attributes). Note: this was introduced by commit5496197f9b("debugfs: Restrict debugfs when the kernel is locked down"), but it didn't matter at that time, as the SELinux support came in later. Fixes:59438b4647("security,lockdown,selinux: implement SELinux lockdown") Cc: stable <[email protected]> Signed-off-by: Ondrej Mosnacek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>