Skip to main content
Vulnerability Database/CVE-2026-97942

CVE-2026-97942: Linux Kernel Race Condition Vulnerability

CVE-2026-97942 is a race condition flaw in the Linux kernel x86 alternatives patching code that occurs when text poking races with change_page_attr operations. This article covers technical details, impact, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-97942 Overview

CVE-2026-97942 is a race condition in the Linux kernel's x86 alternatives patching code. The flaw triggers a BUG_ON() in __text_poke() when vmalloc_to_page() fails during concurrent text poking and change page attribute (CPA) operations. When CONFIG_ARCH_HAS_EXECMEM_ROX=y, modules share a single execmem vmalloc range and can call set_memory_*() in parallel, racing against __text_poke and collapsing page tables or breaking PMD hugepages. The upstream fix excludes CPA against text poking using the init_mm mmap read lock. The issue surfaces during module loading via the static call update path.

Critical Impact

A local race between text poking and page attribute changes can crash the kernel through a BUG_ON() in arch/x86/kernel/alternative.c, producing a denial of service on affected x86 systems.

Affected Products

  • Linux kernel on x86 architectures
  • Builds with CONFIG_ARCH_HAS_EXECMEM_ROX=y
  • Kernel versions prior to the commits referenced in the stable tree

Discovery Timeline

  • 2026-09-25 - CVE-2026-97942 published to NVD
  • 2026-09-25 - Last updated in NVD database

Technical Details for CVE-2026-97942

Vulnerability Analysis

The vulnerability lives in the x86 alternatives patching path. The __text_poke() routine calls vmalloc_to_page() to resolve physical pages backing a virtual address before patching kernel instructions. When this lookup fails, the kernel executes BUG_ON(!pages[0] || (cross_page_boundary && !pages[1])) at arch/x86/kernel/alternative.c:2576, terminating the running task and producing an invalid opcode oops.

The failure is reachable from the module loading path through smp_text_poke_batch_finish(), __static_call_transform(), and static_call_module_notify(). Any workload that loads modules while another thread modifies memory attributes on the shared execmem range can observe the crash.

Root Cause

The root cause is a missing synchronization boundary between text poking and change_page_attr (CPA). vmalloc_to_page() assumes a stable page table layout, but CPA can collapse page tables or break PMD hugepages mid-walk. Most callers of vmalloc_to_page() own their vmalloc range exclusively. With CONFIG_ARCH_HAS_EXECMEM_ROX=y, multiple modules share one execmem vmalloc region and can call set_memory_*() in parallel against it, creating a race window.

Attack Vector

Triggering the condition requires local activity that loads kernel modules while concurrent set_memory_*() calls operate on the shared execmem range. The resulting kernel BUG causes a denial of service. The upstream commits add exclusion using the init_mm mmap read lock so text poking no longer races with CPA. Refer to the stable tree commits for the exact patch content: kernel commit 1587d339, kernel commit 281e6f53, and kernel commit 89c60435.

Detection Methods for CVE-2026-97942

Indicators of Compromise

  • Kernel log entry kernel BUG at arch/x86/kernel/alternative.c:2576! accompanied by Oops: invalid opcode.
  • Stack traces containing __text_poke, smp_text_poke_batch_finish, __static_call_transform, and static_call_module_notify near module load events.
  • Unexpected task termination or system crash correlated with finit_module or init_module syscalls.

Detection Strategies

  • Parse dmesg and persistent kernel crash reports for the specific BUG_ON signature in __text_poke.
  • Correlate module loading telemetry with kernel oops events on x86 hosts built with CONFIG_ARCH_HAS_EXECMEM_ROX=y.
  • Monitor kdump or pstore collections for recurring crashes during driver or module initialization.

Monitoring Recommendations

  • Centralize kernel log collection from Linux endpoints and alert on invalid opcode and kernel BUG at arch/x86/kernel/alternative.c strings.
  • Track module load frequency and failures through audit subsystem rules on the finit_module syscall.
  • Review kernel package inventory to identify hosts running vulnerable builds and prioritize patch coverage.

How to Mitigate CVE-2026-97942

Immediate Actions Required

  • Apply the stable kernel update that contains the three referenced commits adding init_mm mmap read lock exclusion against CPA.
  • Reboot affected hosts after kernel package upgrade so the patched text poking logic is active.
  • Audit kernel build configurations and prioritize hosts with CONFIG_ARCH_HAS_EXECMEM_ROX=y enabled.

Patch Information

The fix is published in the Linux stable tree. See kernel commit 1587d339, kernel commit 281e6f53, and kernel commit 89c60435. Distribution-provided kernels should be updated through the vendor package manager once the backport is available.

Workarounds

  • Restrict module loading to trusted administrators and reduce dynamic module activity on exposed hosts.
  • Where feasible, rebuild kernels without CONFIG_ARCH_HAS_EXECMEM_ROX=y until the patched build is deployed.
  • Enforce modules_disabled=1 via sysctl after required modules are loaded on long-running production systems.
bash
# Configuration example
# Disable further module loading at runtime after boot
sysctl -w kernel.modules_disabled=1

# Verify kernel version matches the patched build
uname -r

# Inspect kernel ring buffer for the BUG signature
dmesg -T | grep -E 'alternative\.c|__text_poke|invalid opcode'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.