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.
Unified · Split
| @@ -1385,7 +1385,8 @@ static int check_prlimit_permission(struct task_struct *task) · 1384 unmodified lines | ||
| 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 || |