KernelScan.io

HIGH Introduced in 6.17

futex HashAlloc UAF

CVE-2026-80775

CVSS 7.4 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

01

In the Linux kernel, the following vulnerability has been resolved: futex: Fix race on the initial mm->futex.phash.ref allocation futex_hash_allocate() allocates mm->futex.phash.ref without any locking. Commit d9b05321e21e ("futex: Move futex_hash_free() back to __mmput()") moved the allocation here and assumed that the process has just a single thread at this point. Commit ee9dce44362b ("futex: Drop CLONE_THREAD requirement for private default hash alloc") widened need_futex_hash_allocate_default() to cover any CLONE_VM clone, but left out vfork because the parent is suspended and cannot race. That no longer holds once vfork is nested. If a vfork child calls vfork again and is then killed with SIGKILL, the parent is released from its vfork wait and runs concurrently with the grandchild in the same mm. Neither of them went through futex_hash_allocate_default(). When both call prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_SET_SLOTS) at the same time, each one sees mm->futex.phash.ref as NULL and stores its own percpu counter. Only the last store survives. The counter stored first is no longer reachable from the mm, so the references on it are not seen by __futex_ref_atomic_end(). A private hash that still has references is then considered dead and freed, and a task that still holds one of its buckets writes into freed memory in futex_q_lock(). Store the counter once with cmpxchg() and let the loser free_percpu() its own. The initial reference has to be taken before the store, otherwise another task can install a private hash while the counter is still 0.

02

Engine v0.6.0

Risk summary

A local unprivileged attacker can exploit a race in the futex private hash allocation to cause a use-after-free, leading to writes into freed kernel memory. This can result in kernel-level code execution, privilege escalation, or a system crash. The bug is reachable by any local process using nested vfork and prctl, with no special capabilities required.

Affectedkernel/futex/core.c (futex)

Vulnerability analysis

The kernel's futex mechanism allocates a reference counter for each process's private hash table without ensuring only one thread can do so at a time. It assumed the allocating task would always be alone in its address space, but that assumption fails when a vfork child itself calls vfork and then dies: the grandparent and grandchild can end up running concurrently in the same memory context. If both try to set up the hash table through the prctl interface at the same moment, each may create its own counter and store it, but only one store wins. The losing counter is forgotten while still holding active references, so the hash table it tracks may be freed while another task is using it. A later futex operation then writes to memory that has already been released. The correction ensures the counter is published exactly once using an atomic compare operation, and the task that loses the race frees its own allocation. The initial reference is established before the counter is visible to other tasks, preventing a window where the count could be zero. Any unprivileged local user can reach this by nesting vfork calls and invoking the affected prctl command; no special privileges or hardware access are needed.

03

BranchIntroducedFixed inPatch commit
6.186.176.18.4786d12b34bafc
7.16.177.1.11ff252ed45c82
7.26.177.2.1c4b4972d8edc
mainline6.177.3bde023808364