Skip to content

Commit

Permalink
Fix prlimit64 for suid/sgid processes
Browse files Browse the repository at this point in the history
Since check_prlimit_permission always fails in the case of SUID/GUID
processes, such processes are not able to read or set their own limits.
This commit changes this by assuming that process can always read/change
its own limits.

Signed-off-by: Kacper Kornet <[email protected]>
Acked-by: Jiri Slaby <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Kacper Kornet authored and torvalds committed Jan 31, 2011
1 parent 2f215a7 commit aa5bd67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,8 @@ static int check_prlimit_permission(struct task_struct *task)
const struct cred *cred = current_cred(), *tcred;

tcred = __task_cred(task);
if ((cred->uid != tcred->euid ||
if (current != task &&
(cred->uid != tcred->euid ||
cred->uid != tcred->suid ||
cred->uid != tcred->uid ||
cred->gid != tcred->egid ||
Expand Down

0 comments on commit aa5bd67

Please sign in to comment.