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

CVE-2026-98031: Linux Kernel Use-After-Free Vulnerability

CVE-2026-98031 is a use-after-free flaw in the Linux kernel nexthop component that causes uninitialized pointer dereference. This article covers the technical details, affected kernel versions, and mitigation strategies.

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-98031 Overview

CVE-2026-98031 affects the Linux kernel's nexthop subsystem. The remove_nh_grp_entry() function dereferences an uninitialized extack stack pointer when a listener fails to replace a reduced nexthop group. Listeners such as netdevsim and mlxsw do not set an error message when an allocation fails, which triggers the uninitialized read. The upstream fix zero-initializes extack, mirroring the pattern established in commit 6347c5314cee for nh_res_bucket_migrate().

Critical Impact

Dereferencing an uninitialized stack pointer in kernel context can trigger kernel panics, denial-of-service conditions, or unpredictable behavior on systems using nexthop groups with hardware offload drivers.

Affected Products

  • Linux kernel versions containing the vulnerable remove_nh_grp_entry() nexthop implementation
  • Systems using netdevsim for network device simulation
  • Systems using the mlxsw driver for Mellanox switch hardware offload

Discovery Timeline

  • 2026-09-25 - CVE-2026-98031 published to the National Vulnerability Database (NVD)
  • 2026-09-25 - Last updated in NVD database

Technical Details for CVE-2026-98031

Vulnerability Analysis

The Linux kernel nexthop subsystem manages next-hop routing entries, including nexthop groups that can be replaced or reduced at runtime. When a group entry is removed, remove_nh_grp_entry() notifies registered listeners about the reduced group. If a listener returns an error during this replacement, the function attempts to print an error message using the extack (extended ACK) structure.

The extack structure is allocated on the kernel stack but never explicitly initialized. The nexthop subsystem assumes listeners populate it on failure, but listeners are not required to do so. Drivers including netdevsim and mlxsw return errors for allocation failures without setting an extack message. The subsequent attempt to read the message dereferences uninitialized stack memory.

Root Cause

The root cause is uninitialized memory use [CWE-908] in a kernel stack-allocated structure. The nexthop code assumed listener contracts that are not enforced across all notifier callers. This mirrors a prior defect fixed in commit 6347c5314cee for nh_res_bucket_migrate(), where the same pattern required zero-initialization of extack.

Attack Vector

Exploitation requires the ability to trigger nexthop group modifications that force a listener allocation failure. On systems using mlxsw hardware offload or netdevsim, memory pressure or crafted routing configurations can push a listener into an error path without setting extack. The read of the uninitialized stack pointer then produces undefined behavior inside the kernel, most commonly a crash. The flaw is a local reliability and robustness issue rather than a remote vector.

No verified proof-of-concept code is available. See the upstream fixes referenced in the Kernel Git Commit d80677a and companion backport commits for the exact code change.

Detection Methods for CVE-2026-98031

Indicators of Compromise

  • Kernel oops or panic messages originating in remove_nh_grp_entry within the nexthop subsystem
  • dmesg traces referencing mlxsw or netdevsim listener failures during nexthop group replacement
  • Unexpected network interface or routing table instability on systems using hardware-offloaded nexthop groups

Detection Strategies

  • Enable KASAN (Kernel Address Sanitizer) in test environments to catch uninitialized memory reads in the nexthop code path
  • Monitor kernel logs for stack traces that include remove_nh_grp_entry and nexthop symbols
  • Audit installed kernel versions against the fixed commits published in the stable tree

Monitoring Recommendations

  • Centralize kernel log collection and alert on BUG:, KASAN:, or Oops: entries referencing nexthop functions
  • Track routing daemon errors and mlxsw driver failures that correlate with memory pressure events
  • Inventory nodes running Mellanox switch offload or netdevsim-based test infrastructure for prioritized patching

How to Mitigate CVE-2026-98031

Immediate Actions Required

  • Identify Linux hosts running kernels with the vulnerable remove_nh_grp_entry() implementation, especially those with mlxsw or netdevsim loaded
  • Apply the upstream patch or update to a stable kernel release containing the fix
  • Reduce exposure to memory-pressure conditions on affected switches and routers until patching is complete

Patch Information

The fix zero-initializes extack in remove_nh_grp_entry(). The change is available in the following stable kernel commits: Kernel Git Commit 030c878, Kernel Git Commit 5bd9e4e, Kernel Git Commit d643cea, and Kernel Git Commit d80677a.

Workarounds

  • Unload the netdevsim module on production systems where it is not required
  • Avoid dynamic nexthop group replacements on mlxsw-managed interfaces until the kernel is patched
  • Apply strict memory limits and monitoring to reduce the likelihood of listener allocation failures
bash
# Check running kernel version and loaded nexthop-related modules
uname -r
lsmod | grep -E 'mlxsw|netdevsim'

# Remove netdevsim if not required
sudo modprobe -r netdevsim

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.