]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Fix prlimit64 for suid/sgid processes
authorKacper Kornet <kornet@camk.edu.pl>
Fri, 28 Jan 2011 23:21:04 +0000 (00:21 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 23:14:34 +0000 (15:14 -0800)
commit aa5bd67dcfdf9af34c7fa36ebc87d4e1f7e91873 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/sys.c

index 7f5a0cd296a96ca44e43f0db028026094dbbb57a..66136ca33a7b160d9d2ea255b04a034b98ece805 100644 (file)
@@ -1377,7 +1377,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 ||