diff options
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 5c9f25ba1c95..e3ce6b4127cc 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -3371,16 +3371,17 @@ static int selinux_task_getioprio(struct task_struct *p) | |||
3371 | return current_has_perm(p, PROCESS__GETSCHED); | 3371 | return current_has_perm(p, PROCESS__GETSCHED); |
3372 | } | 3372 | } |
3373 | 3373 | ||
3374 | static int selinux_task_setrlimit(unsigned int resource, struct rlimit *new_rlim) | 3374 | static int selinux_task_setrlimit(struct task_struct *p, unsigned int resource, |
3375 | struct rlimit *new_rlim) | ||
3375 | { | 3376 | { |
3376 | struct rlimit *old_rlim = current->signal->rlim + resource; | 3377 | struct rlimit *old_rlim = p->signal->rlim + resource; |
3377 | 3378 | ||
3378 | /* Control the ability to change the hard limit (whether | 3379 | /* Control the ability to change the hard limit (whether |
3379 | lowering or raising it), so that the hard limit can | 3380 | lowering or raising it), so that the hard limit can |
3380 | later be used as a safe reset point for the soft limit | 3381 | later be used as a safe reset point for the soft limit |
3381 | upon context transitions. See selinux_bprm_committing_creds. */ | 3382 | upon context transitions. See selinux_bprm_committing_creds. */ |
3382 | if (old_rlim->rlim_max != new_rlim->rlim_max) | 3383 | if (old_rlim->rlim_max != new_rlim->rlim_max) |
3383 | return current_has_perm(current, PROCESS__SETRLIMIT); | 3384 | return current_has_perm(p, PROCESS__SETRLIMIT); |
3384 | 3385 | ||
3385 | return 0; | 3386 | return 0; |
3386 | } | 3387 | } |