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>

authored by Kacper Kornet and committed by Linus Torvalds aa5bd67d 2f215a7d

+2 -1
+2 -1
kernel/sys.c
··· 1385 1385 const struct cred *cred = current_cred(), *tcred; 1386 1386 1387 1387 tcred = __task_cred(task); 1388 - if ((cred->uid != tcred->euid || 1388 + if (current != task && 1389 + (cred->uid != tcred->euid || 1389 1390 cred->uid != tcred->suid || 1390 1391 cred->uid != tcred->uid || 1391 1392 cred->gid != tcred->egid ||