Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa5bd67d authored by Kacper Kornet's avatar Kacper Kornet Committed by Linus Torvalds
Browse files

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: default avatarKacper Kornet <kornet@camk.edu.pl>
Acked-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2f215a7d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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 ||