Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

apparmor: fix rlimit for posix cpu timers

Posix cpu timers requires an additional step beyond setting the rlimit.
Refactor the code so its clear when what code is setting the
limit and conditionally update the posix cpu timers when appropriate.

Fixes: baa73d9e478ff ("posix-timers: Make them configurable")
Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>

+5
+5
security/apparmor/resource.c
··· 196 196 rules->rlimits.limits[j].rlim_max); 197 197 /* soft limit should not exceed hard limit */ 198 198 rlim->rlim_cur = min(rlim->rlim_cur, rlim->rlim_max); 199 + if (j == RLIMIT_CPU && 200 + rlim->rlim_cur != RLIM_INFINITY && 201 + IS_ENABLED(CONFIG_POSIX_TIMERS)) 202 + (void) update_rlimit_cpu(current->group_leader, 203 + rlim->rlim_cur); 199 204 } 200 205 } 201 206 }