Linux kernel: Missing memory barrier in anon_vma setup
Summary
A missing memory barrier in the Linux kernel memory management code (mm/rmap) can let another thread see an anon_vma structure before its root pointer is initialised. Under a race between two threads faulting on adjacent VMAs, a task can lock the wrong root semaphore, which can hang the task and may corrupt memory through a use-after-free. An attacker needs a local account or code execution on the host, so the risk is highest on shared multi-user Linux systems.
Affected
- Linux kernel from commit 5c341ee1dfc8 onward, until the fixed stable releases.
- Stable branches: 5.10 before 5.10.273; 5.15 before 5.15.224; 6.1 before 6.1.191; 6.6 before 6.6.160; 6.12 before 6.12.112; 6.18 before 6.18.55; 7.2 before 7.2.9.
- 7.3 development series until the fix is included (fixed in 7.3-rc5 according to VulDB).
Fixed in
- Linux kernel 5.10.273, 5.15.224, 6.1.191, 6.6.160, 6.12.112, 6.18.55, 7.2.9 or later.
- Alpaquita Linux: linux-lts 6.12.112-r0 and 6.18.55-r0.
- Ubuntu, Debian, RHEL, SUSE and other distributions: Unknown.
Workaround
- Unknown. No vendor workaround was found; the documented remedy is updating to a fixed kernel.
Exploitation
- No evidence of active exploitation found; Strix lists the CVE as not in CISA KEV.
- No public exploit found; the public write-up describes the race condition.
- The description reports hangs; local attackers may be able to exploit it.
Our recommendation
- Inventory Linux hosts and kernel versions, and prioritise multi-user systems, CI runners and container hosts.
- Install the vendor kernel update as soon as it is available and reboot the affected hosts.
- Track Ubuntu, Debian and RHEL advisories for this CVE.
- Monitor hosts for kernel hangs or unexplained task blockages.
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- CVE Program / Linux CNA record (via OSV) osv.dev
- Linux stable commit 465e222815c8 git.kernel.org
- Linux stable commit badedec499f6 git.kernel.org
- VulDB entry CVE-2026-98507 vuldb.com
- Alpaquita Linux BELL advisory (OSV) osv.dev
- Strix CVE-2026-98507 record www.strix.ai
- Ubuntu CVE tracker ubuntu.com
- Vulners Red Hat CVE record vulners.com
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 23:44.
Original description (NVD)
In the Linux kernel, the following vulnerability has been resolved: mm/rmap: fix missing barrier between anon_vma init and vma->anon_vma publish On arm64 server, we find that a task trying to grab the anon_vma lock triggers hungtask. INFO: task main:2354726 blocked for more than 120 seconds. Tainted: G E 5.10.0-0021.aarch64 #1 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:main state:D stack: 0 pid:2354726 ppid:2350673 flags:0x00000a01 Call trace: __switch_to+0x7c/0xbc __schedule+0x3b4/0x8a0 schedule+0x50/0xe0 rwsem_down_write_slowpath+0x3cc/0x6cc down_write+0x60/0x260 __anon_vma_prepare+0x6c/0x210 do_anonymous_page+0x258/0x660 handle_pte_fault+0x188/0x214 __handle_mm_fault+0x1b0/0x380 handle_mm_fault+0xf4/0x284 do_page_fault+0x19c/0x494 do_translation_fault+0xcc/0xf8 do_mem_abort+0x48/0xac el0_da+0x44/0x80 el0_sync_handler+0x88/0xb4 el0_sync+0x160/0x180 After analyzing the vmcore, we found the anon_vma->root->rwsem.count is -1. There is another anon_vma whose anon_vma->root->rwsem.count is 1, the anon_vma->root->rwsem.owner shows the lock is held, but the stack of the task shows the task doesn't hold the anon_vma lock. After adding more debugging info, we found __anon_vma_prepare() reuses anon_vma and triggers the UAF of anon_vma->root due to missing memory barrier, leading to locking and unlocking two different anon_vma->root, thus leading to an anon_vma will never be unlocked, and another anon_vma couldn't be locked anymore. This race requires two adjacent VMAs that are not merged but are anon_vma-compatible (e.g., they differ in VMA_ACCESS_FLAGS that can be changed by mprotect()). Two threads fault on each VMA concurrently, both calling __anon_vma_prepare() with only mmap_lock held for reading. THREAD A THREAD B __anon_vma_prepare __anon_vma_prepare find_mergeable_anon_vma() -> NULL anon_vma = anon_vma_alloc(); anon_vma->root = anon_vma; // the two stores may be reordered vma->anon_vma = anon_vma; // finds A's anon_vma anon_vma = find_mergeable_anon_vma(vma); anon_vma_lock_write(anon_vma); // may still see the old root down_write(&anon_vma->root->rwsem); anon_vma_unlock_write(anon_vma); // see the new root, never unlock old up_write(&anon_vma->root->rwsem); thread A triggers page fault and calls __anon_vma_prepare() to prepare anon_vma for the faulting vma. __anon_vma_prepare() allocates and initializes a new anon_vma, and then publishes it to the vma with a plain store. anon_vma_prepare() only requires the mmap_lock to be held for reading, so two threads can fault on adjacent VMAs at the same time. While thread A publishes a new anon_vma, thread B could find the anon_vma via find_mergeable_anon_vma() and then locks anon_vma->root->rwsem. The store to anon_vma->root in anon_vma_alloc() and the store to vma->anon_vma can be reordered. The anon_vma_lock_write() and spin_lock() only provide acquire semantics, which do not prevent prior stores from being reordered after them. The release semantics of the corresponding spin_unlock() and anon_vma_unlock_write() come too late, the store to vma->anon_vma is already published before they take effect. As a result, thread B can observe the following order: vma->anon_vma = anon_vma; anon_vma->root = anon_vma; The anon_vma slab is SLAB_TYPESAFE_BY_RCU, so a newly allocated anon_vma may reuse memory from a previously freed one. The constructor (anon_vma_ctor) does not reset anon_vma->root, and __put_anon_vma() doesn't clear it either, so the old root value persists until anon_vma_alloc() overwrites it. If that store isn't v ---truncated---
NVD references (8)
- https://git.kernel.org/stable/c/465e222815c8839445d09028fa4c77e70f7f1c7d
- https://git.kernel.org/stable/c/4cef512a955e4008ae4436a4fc97726976df1fdf
- https://git.kernel.org/stable/c/7d103fc7b836084af585d9d3471334624354cf26
- https://git.kernel.org/stable/c/a500df43cde075f6ea4b8bae495d89f2c35b3e16
- https://git.kernel.org/stable/c/aef0f69b515af1c8a4147f68a46b6b81854f46f7
- https://git.kernel.org/stable/c/b6ac0b3f6013c168f22cad97e79967accacb08e1
- https://git.kernel.org/stable/c/badedec499f6320742368c73fa77cd63dcf8ca55
- https://git.kernel.org/stable/c/d348a715380bfcc6a611bdf722169d53fd01e735
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
