proc: protect ptrace_may_access() with exec_update_lock (FD links)
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 778c1144771f0064b6f51bee865cceb0d996f2f9 · < 497c6bae5167428596575f20af6613ff5671f383| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
proc: protect ptrace_may_access() with exec_update_lock (FD links)
proc_pid_get_link() and proc_pid_readlink() currently look up the task from the pid once, then do the ptrace access check on that task, then look up the task from the pid a second time to do the actual access. That's racy in several ways.
To fix it, pass the task to the ->proc_get_link() handler, and instead of proc_fd_access_allowed(), introduce a new helper call_proc_get_link() that looks up and locks the task, does the access check, and calls ->proc_get_link().
From the CVE record · Linux
The Linux kernel has a race in proc FD-link handling: it looks up a task for a ptrace access check, then looks it up again to access the link. A local attacker may be able to access a link associated with a different task than the one checked. The input does not specify required privileges or user interaction.
Engineers running Linux kernels should check their vendor's advisory for affected versions.