]> git.proxmox.com Git - mirror_ubuntu-focal-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 13:19:16 +0000 (15:19 +0200)
commit1a599a45ba9f455e73a9c1d744a9d63357ef5603
treed87b6cb2e2810b38f6033732ae08ce235349aec4
parentf90041f0d433222630a1c58635534b0053850ce1
LSM: general protection fault in legacy_parse_param

BugLink: https://bugs.launchpad.net/bugs/1971497
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
security/security.c
security/selinux/hooks.c