aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorKacper Kornet <kornet@camk.edu.pl>2011-01-28 18:21:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-30 22:01:27 -0500
commitaa5bd67dcfdf9af34c7fa36ebc87d4e1f7e91873 (patch)
tree95196496421cd8e7ad4c655becf2fa3309c88052 /kernel/sys.c
parent2f215a7d6d1d8ed0bbdda4fc4f7d64e3a1d46acc (diff)
Fix prlimit64 for suid/sgid processes
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 <kornet@camk.edu.pl> Acked-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 31b71a276b40..18da702ec813 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1385,7 +1385,8 @@ static int check_prlimit_permission(struct task_struct *task)
1385 const struct cred *cred = current_cred(), *tcred; 1385 const struct cred *cred = current_cred(), *tcred;
1386 1386
1387 tcred = __task_cred(task); 1387 tcred = __task_cred(task);
1388 if ((cred->uid != tcred->euid || 1388 if (current != task &&
1389 (cred->uid != tcred->euid ||
1389 cred->uid != tcred->suid || 1390 cred->uid != tcred->suid ||
1390 cred->uid != tcred->uid || 1391 cred->uid != tcred->uid ||
1391 cred->gid != tcred->egid || 1392 cred->gid != tcred->egid ||