]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selinux: fix a capabilities parsing typo in selinux_bpf_token_capable()
authorPaul Moore <paul@paul-moore.com>
Wed, 14 Jan 2026 21:00:14 +0000 (16:00 -0500)
committerPaul Moore <paul@paul-moore.com>
Wed, 14 Jan 2026 21:15:09 +0000 (16:15 -0500)
There was a typo, likely a cut-n-paste bug, where we were checking for
SECCLASS_CAPABILITY instead of SECCLASS_CAPABILITY2.

Fixes: 5473a722f782 ("selinux: add support for BPF token access control")
Reported-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c

index c7c19ceeeb2f165f355365e935dd84841dff0f84..9289ed89a8ec838d094222fd4f25e3b8cb534f25 100644 (file)
@@ -7260,7 +7260,7 @@ static int selinux_bpf_token_capable(const struct bpf_token *token, int cap)
                sclass = initns ? SECCLASS_CAPABILITY : SECCLASS_CAP_USERNS;
                break;
        case 1:
-               sclass = initns ? SECCLASS_CAPABILITY : SECCLASS_CAP2_USERNS;
+               sclass = initns ? SECCLASS_CAPABILITY2 : SECCLASS_CAP2_USERNS;
                break;
        default:
                pr_err("SELinux:  out of range capability %d\n", cap);