From: Kacper Kornet Date: Fri, 28 Jan 2011 23:21:04 +0000 (+0100) Subject: Fix prlimit64 for suid/sgid processes X-Git-Tag: v2.6.38-rc3~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa5bd67dcfdf9af34c7fa36ebc87d4e1f7e91873;p=platform%2Fkernel%2Flinux-exynos.git 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 Acked-by: Jiri Slaby Signed-off-by: Linus Torvalds --- diff --git a/kernel/sys.c b/kernel/sys.c index 31b71a2..18da702 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -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 ||