CVE-2026-80778: futex/pi: Reject cross-mm private futex owners
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
futex/pi: Reject cross-mm private futex owners
A private futex key borrows the waiter's mm without taking an mm_users reference. Nevertheless, attach_to_pi_owner() currently accepts an owner from a different address space and copies the private key into the owner's PI state.
When that owner exits, exit_pi_state_list() uses the saved key to find the hash bucket and acquires a reference to the waiter's private hash. If the last user of the waiter's mm exits concurrently, futex_hash_free() frees the hash while the owner still uses its bucket and reference.
Prevent this by validating in attach_to_pi_owner() that, for private futexes, the owner mm and waiter mm are the same. Perform the check with the owner's pi_lock held and after validating owner::futex::state to serialize against a concurrent PI-state exit cleanup.
[ tglx: Amended comment ]
The Linux kernel CVE team has assigned CVE-2026-80778 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.16 with commit 80367ad01d93ac781b0e1df246edaf006928002f and fixed in 6.18.47 with commit 2b92e5562653b5293529f63b0300837d9dcedbd7 Issue introduced in 6.16 with commit 80367ad01d93ac781b0e1df246edaf006928002f and fixed in 7.1.11 with commit f7fb3e07752688842cbe0b85cf0d98c2fbf76b68 Issue introduced in 6.16 with commit 80367ad01d93ac781b0e1df246edaf006928002f and fixed in 7.2.1 with commit 43b148d796aa338858792d0167cebdc12b8cb4b9 Issue introduced in 6.16 with commit 80367ad01d93ac781b0e1df246edaf006928002f and fixed in 7.3-rc1 with commit 59b3732f95dda1fbd2234514d35f4fb6b5bb6d85
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-80778
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
kernel/futex/pi.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/2b92e5562653b5293529f63b0300837d9dcedbd7 https://git.kernel.org/stable/c/f7fb3e07752688842cbe0b85cf0d98c2fbf76b68 https://git.kernel.org/stable/c/43b148d796aa338858792d0167cebdc12b8cb4b9 https://git.kernel.org/stable/c/59b3732f95dda1fbd2234514d35f4fb6b5bb6d85