CVE-2026-89766: pidfd: hold exec_update_lock around namespace ioctl
In the Linux kernel, the following vulnerability has been resolved:
pidfd: hold execupdatelock around namespace ioctl
The PIDFDGETNAMESPACE ioctls in pidfdioctl() perform a filesystem credentials ptrace access check before handing out a namespace file descriptor. The accompanying comment states that the code "mirrors nsfs behavior", but, unlike the corresponding procfs paths, it does so without holding the target task's execupdatelock.
procnsgetlink() and procnsreadlink() both take execupdatelock for reading around the ptrace check and the namespace lookup, so that the credentials used for the access decision match those of the task when its namespace is read. Without it, a caller can pass the check against the target's old credentials and then read the namespace after the target has execve()'d a setuid binary and committed new credentials -- accessing namespace information it should have been denied.
Hold execupdatelock for reading around the ptrace check and the namespace lookup so that pidfd truly mirrors nsfs behavior, as the comment already claims. opennamespace() itself runs outside the lock: once a namespace reference is obtained it carries its own refcount and is opened with the caller's own credentials, so a concurrent execve() on the target can no longer affect the outcome.
Event History
Frequently Asked Questions
What conditions are required to exploit this issue?
An attacker needs a pidfd for a target task and must invoke a PIDFD_GET_*_NAMESPACE ioctl while the target transitions through execve() of a setuid binary. The access check must succeed using the target's old credentials before the ioctl obtains namespace information under the new credentials.
Which systems or workloads are realistically exposed?
Exposure is limited to Linux kernel users of the PIDFD_GET_*_NAMESPACE ioctls where a target process can exec a setuid binary. The issue is a race between the ptrace-style filesystem credential check and the target's credential and namespace state during execve().
What is the impact of winning the race?
The caller can obtain namespace information after the target has committed credentials that should have caused access to be denied. This can disclose namespace information that the caller would not otherwise be permitted to read.