Skip to content

Commit b07b6f0

Browse files
committed
selinux: fix a capabilities parsing typo in selinux_bpf_token_capable()
There was a typo, likely a cut-n-paste bug, where we were checking for SECCLASS_CAPABILITY instead of SECCLASS_CAPABILITY2. Fixes: 5473a72 ("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>
1 parent 5473a72 commit b07b6f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/selinux/hooks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7260,7 +7260,7 @@ static int selinux_bpf_token_capable(const struct bpf_token *token, int cap)
72607260
sclass = initns ? SECCLASS_CAPABILITY : SECCLASS_CAP_USERNS;
72617261
break;
72627262
case 1:
7263-
sclass = initns ? SECCLASS_CAPABILITY : SECCLASS_CAP2_USERNS;
7263+
sclass = initns ? SECCLASS_CAPABILITY2 : SECCLASS_CAP2_USERNS;
72647264
break;
72657265
default:
72667266
pr_err("SELinux: out of range capability %d\n", cap);

0 commit comments

Comments
 (0)