CVE-2026-98788: futex: Fix private hash use-after-free on resize
In the Linux kernel, the following vulnerability has been resolved:
futex: Fix private hash use-after-free on resize
pollstatesynchronizercu(mm->futex.phash.batches) is used by futexrefdrop() to check that a grace period has passed since the current hash was published. This relies on batches referencing a grace period which started after the hash pointer was assigned.
futexpivothash() sets mmph->batches before it replaces mmph->hash:
scopedguard(rcu) { mmph->batches = getstatesynchronizercu(); rcuassignpointer(mmph->hash, new); }
The scopedguard(rcu) doesn't stop new grace periods from starting, and if one starts between those two assignments, futexrefdrop() can move forward while a reader still holds a pointer to the old hash.
Fix things by setting mmph->batches after assigning mmph->hash. The scopedguard(rcu) isn't needed, so let's drop that as well.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In the Linux kernel futex hash resize implementation, assign the new hash with rcu_assign_pointer(mmph->hash, new) before setting mmph->batches = get_state_synchronize_rcu(); use poll_state_synchronize_rcu(mm->futex.phash.batches) in futex_ref_drop(), and remove the unnecessary scoped_guard(rcu).