- Code: Select all
if (!ptrace_may_access(p, PTRACE_MODE_READ))
goto err_unlock;
instead of:
- Code: Select all
pcred = __task_cred(p);
if (cred->euid != pcred->euid &&
cred->euid != pcred->uid &&
!capable(CAP_SYS_PTRACE))
goto err_unlock;
Now, ptrace_may_access(), does check the current process' uid against the target process' euid:
- Code: Select all
tcred = __task_cred(task);
if ((cred->uid != tcred->euid ||
but not the opposite. This causes this code, run as 'root':
- Code: Select all
seteuid(1);
get_robust_list(1, &head, &len);
to succeed, while it fails on a non PROC_MEMMAP-enabled kernel.
What is the rationale behind this difference ?