Skip to content

Commit 11c92f1

Browse files
committed
apparmor: fix mediation of prlimit
For primit apparmor requires that if target confinement does not match the setting task's confinement, the setting task requires CAP_SYS_RESOURCE. Unfortunately this was broken when rlimit enforcement was reworked to support labels. Fixes: 86b92cb ("apparmor: move resource checks to using labels") Signed-off-by: John Johansen <[email protected]>
1 parent a4c3f89 commit 11c92f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/apparmor/resource.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ int aa_task_setrlimit(struct aa_label *label, struct task_struct *task,
124124
*/
125125

126126
if (label != peer &&
127-
!aa_capable(label, CAP_SYS_RESOURCE, SECURITY_CAP_NOAUDIT))
127+
aa_capable(label, CAP_SYS_RESOURCE, SECURITY_CAP_NOAUDIT) != 0)
128128
error = fn_for_each(label, profile,
129129
audit_resource(profile, resource,
130130
new_rlim->rlim_max, peer,

0 commit comments

Comments
 (0)