Skip to content

Commit dc15561

Browse files
committed
apparmor: Fix internal policy capable check for policy management
The check was incorrectly treating a returned error as a boolean. Fixes: 31ec99e ("apparmor: switch to apparmor to internal capable check for policy management") Signed-off-by: John Johansen <[email protected]>
1 parent d108370 commit dc15561

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/apparmor/policy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ bool aa_policy_view_capable(struct aa_label *label, struct aa_ns *ns)
678678
bool aa_policy_admin_capable(struct aa_label *label, struct aa_ns *ns)
679679
{
680680
struct user_namespace *user_ns = current_user_ns();
681-
bool capable = policy_ns_capable(label, user_ns, CAP_MAC_ADMIN);
681+
bool capable = policy_ns_capable(label, user_ns, CAP_MAC_ADMIN) == 0;
682682

683683
AA_DEBUG("cap_mac_admin? %d\n", capable);
684684
AA_DEBUG("policy locked? %d\n", aa_g_lock_policy);

0 commit comments

Comments
 (0)