diff options
author | Kacper Kornet <kornet@camk.edu.pl> | 2011-01-29 00:21:04 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-17 15:14:34 -0800 |
commit | 191c11d6061187dc2955c6f53bf04d4c6b1e482c (patch) | |
tree | bd354f48779e3b6e0a12322191939a5cc6f629d2 /kernel | |
parent | f045961680a61667bb15a33408ad2215d1a396ee (diff) |
Fix prlimit64 for suid/sgid processes
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sys.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 7f5a0cd296a9..66136ca33a7b 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -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 || |