Skip to content

Commit

Permalink
SECURITY: selinux, fix update_rlimit_cpu parameter
Browse files Browse the repository at this point in the history
Don't pass current RLIMIT_RTTIME to update_rlimit_cpu() in
selinux_bprm_committing_creds, since update_rlimit_cpu expects
RLIMIT_CPU limit.

Use proper rlim[RLIMIT_CPU].rlim_cur instead to fix that.

Signed-off-by: Jiri Slaby <[email protected]>
Acked-by: James Morris <[email protected]>
Cc: Stephen Smalley <[email protected]>
Cc: Eric Paris <[email protected]>
Cc: David Howells <[email protected]>
  • Loading branch information
jirislaby authored and Jiri Slaby committed Jan 4, 2010
1 parent 45d28b0 commit 17740d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -2365,7 +2365,7 @@ static void selinux_bprm_committing_creds(struct linux_binprm *bprm)
initrlim = init_task.signal->rlim + i;
rlim->rlim_cur = min(rlim->rlim_max, initrlim->rlim_cur);
}
update_rlimit_cpu(rlim->rlim_cur);
update_rlimit_cpu(current->signal->rlim[RLIMIT_CPU].rlim_cur);
}
}

Expand Down

0 comments on commit 17740d8

Please sign in to comment.