CVE-2026-99839: pidfs: don't let PIDFD_GET_INFO miss a reaped task
In the Linux kernel, the following vulnerability has been resolved:
pidfs: don't let PIDFDGETINFO miss a reaped task
PIDFDGETINFO describes the task while there is one, and with PIDFDINFOEXIT its exit status once it has been reaped. pidfdinfo() looks at the two in the wrong order and can miss both:
pidfdinfo() releasetask() PIDFSATTRBITEXIT is not set pidfsexit() unhashprocess() getpidtask() == NULL goto copyout
The ioctl succeeds with neither PIDFDINFOPID nor PIDFDINFOEXIT in the mask. If the task is unhashed a little later, after getpidtask(), its pid reads as 0 and the ioctl fails with -ESRCH, although the caller asked for the exit information and it is available by now.
The second case does not even need an exit. When a sub-thread execs, dethread() hands the leader's pid over to it and releases the old leader. A caller that got hold of the old leader reports the tid of the sub-thread as the pid, or -ESRCH for a process that is alive.
Look up the task first. pidfsexit() runs before the task is unhashed, so a caller that finds no task finds the exit information; this needs a barrier on both sides because taking tasklistlock does not order the store in pidfsexit() against the one in detachpid(). And start over if the task no longer owns the pid when all the fields have been read: then there is either exit information or another task.
Go by the pid for that check and for the pid we report, not by ->threadpid of the task. exchangetids() moves the pid to the exec'ing thread before it updates ->threadpid of either task. A caller that finds the new leader in between would read the old tid of the sub-thread from ->threadpid, and a check of ->threadpid would restart until the exec'ing thread gets to its store. On PREEMPTRT that thread can be preempted with tasklistlock held and can't move to another CPU. If the RT task that preempted it calls PIDFDGETINFO, the ioctl spins until the exec'ing thread gets the CPU back, and that never happens if the exec'ing thread is an RT task of lower priority.
Christian Brauner <brauner@kernel.org> says:
Go by @pid instead of ->threadpid of the task for the reported pid and for the restart check.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.65 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1
Event History
Frequently Asked Questions
Who is exposed to this issue?
Systems using the Linux kernel and invoking the PIDFD_GET_INFO ioctl on pidfds can be affected. The issue is tied to races involving task reaping or a sub-thread executing and replacing a process leader.
What behavior might indicate that this issue is occurring?
PIDFD_GET_INFO may succeed while returning neither PIDFD_INFO_PID nor PIDFD_INFO_EXIT. It may also report a PID of 0, return -ESRCH even though exit information is available, or return -ESRCH for a process that is still alive after a sub-thread exec transition.
Does exploitation require a task to exit?
No. One described case occurs when a sub-thread performs exec and de_thread() transfers the leader PID to that thread while releasing the old leader.