]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
LSM: general protection fault in legacy_parse_param
authorCasey Schaufler <casey@schaufler-ca.com>
Thu, 27 Jan 2022 04:51:00 +0000 (04:51 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:39:40 +0000 (14:39 +0200)
commitb0af8cdd5aa1064d8cbfbe566751d919eb3bca9c
treee160a25543f34def706b71f871a315c898430ce1
parentc24e4c894f491e69a19598d0a1013213ead9f0f8
LSM: general protection fault in legacy_parse_param

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit ecff30575b5ad0eda149aadad247b7f75411fd47 ]

The usual LSM hook "bail on fail" scheme doesn't work for cases where
a security module may return an error code indicating that it does not
recognize an input.  In this particular case Smack sees a mount option
that it recognizes, and returns 0. A call to a BPF hook follows, which
returns -ENOPARAM, which confuses the caller because Smack has processed
its data.

The SELinux hook incorrectly returns 1 on success. There was a time
when this was correct, however the current expectation is that it
return 0 on success. This is repaired.

Reported-by: syzbot+d1e3b1d92d25abf97943@syzkaller.appspotmail.com
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Acked-by: James Morris <jamorris@linux.microsoft.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit f3f93a1aaafc3032e0a9655fb43deccfb3e953a3)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
security/security.c
security/selinux/hooks.c