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

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

CVE-2026-98014 is a use-after-free flaw in the Linux kernel's mlx5 E-Switch driver that corrupts memory during vport disable operations. This post explains the technical details, affected systems, 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-98014 Overview

CVE-2026-98014 is a use-after-free vulnerability in the Linux kernel's Mellanox 5 (mlx5) Ethernet driver. The flaw resides in the E-Switch vport disable path, specifically in mlx5_esw_vport_disable(). During firmware-fatal recovery, the function esw_apply_vport_rx_mode() runs after esw_vport_change_handle_locked(), leaving vport->allmulti_rule populated. The resulting repopulation of mc_list entries causes dangling flow-rule pointers after the legacy FDB is destroyed, producing a refcount underflow and page fault on reload.

Critical Impact

A PCI reset or firmware recovery on affected hosts triggers kernel memory corruption, enabling denial of service or potential local privilege escalation through use-after-free of flow-rule objects.

Affected Products

  • Linux kernel versions containing the mlx5_core E-Switch legacy mode implementation prior to the fixing commits
  • Systems using Mellanox ConnectX adapters with SR-IOV vports in legacy E-Switch mode
  • Distributions shipping the mlx5_core driver without the backported fix

Discovery Timeline

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

Technical Details for CVE-2026-98014

Vulnerability Analysis

The vulnerability is a use-after-free [CWE-416] in the mlx5_core E-Switch subsystem. During a firmware-fatal recovery triggered by echo 1 > /sys/bus/pci/devices/<bdf>/reset, the device enters INTERNAL_ERROR state. When mlx5_esw_vport_disable() executes, it calls esw_vport_change_handle_locked() before esw_apply_vport_rx_mode(). The promisc query inside esw_update_vport_rx_mode() fails early because of the error state, so vport->allmulti_rule is never cleared.

With the stale rule pointer intact, esw_update_vport_mc_promisc() queues MLX5_ACTION_ADD entries into vport->mc_list. Those entries flow through esw_add_mc_addr() and are installed in the Flow Database (FDB). The subsequent call to esw_destroy_legacy_table() tears down the FDB while references are still held, leaving dangling flow-rule pointers.

Root Cause

The root cause is an incorrect ordering of state-cleanup operations. esw_apply_vport_rx_mode(false, false) always clears vport->allmulti_rule through its local state machine, even when the firmware delete command fails. Because this cleanup runs after the change handler, the !IS_ERR_OR_NULL(allmulti_rule) gate in the handler evaluates true and triggers rule repopulation against a soon-to-be-destroyed FDB.

Attack Vector

The fault chain triggers on any PCI reset or health-recovery event on an affected adapter. The first observable failure is a refcount_t: underflow; use-after-free warning in tree_put_node+0xef/0x110 [mlx5_core] during mlx5_fs_core_cleanup. On the subsequent reload path, mlx5_esw_vport_enable calls esw_apply_vport_addr_list, which dereferences the dangling pointer and produces a page fault at an unmapped address such as 0000000003000055 inside mlx5_del_flow_rules. Local users with permission to initiate PCI resets, or any condition that triggers firmware recovery, can reach this path.

No verified public exploit code is available. The vulnerability mechanism is described in the upstream kernel commits referenced below.

Detection Methods for CVE-2026-98014

Indicators of Compromise

  • Kernel log entries containing refcount_t: underflow; use-after-free with call traces through tree_put_node, clean_tree, and mlx5_fs_core_cleanup in the mlx5_core module
  • Page fault messages referencing mlx5_del_flow_rules, esw_del_mc_addr, or esw_apply_vport_addr_list on the reload path after a device reset
  • Repeated mlx5_health_try_recover events preceding kernel oops conditions on hosts running Mellanox NICs

Detection Strategies

  • Monitor dmesg and journald for mlx5_core stack traces that chain through esw_vport_change_handle_locked and flow-rule destruction functions
  • Correlate PCI reset events (/sys/bus/pci/devices/*/reset writes) with subsequent kernel warnings on hosts running affected kernel builds
  • Baseline kernel module versions across the fleet and alert when mlx5_core is loaded from an unpatched kernel on hosts exposing SR-IOV vports

Monitoring Recommendations

  • Forward kernel ring-buffer events to a centralized logging pipeline and parse for the specific mlx5_core call-trace signatures listed above
  • Track NIC firmware-recovery counters exposed through devlink health to detect preconditions that reach the vulnerable code path
  • Alert on unplanned link flaps, SR-IOV vport bounces, or driver reloads that correlate with kernel oops events

How to Mitigate CVE-2026-98014

Immediate Actions Required

  • Apply the upstream kernel patches referenced below or install the vendor-backported kernel update for your distribution
  • Avoid issuing manual PCI resets against Mellanox adapters on unpatched hosts until the fix is deployed
  • Restrict write access to /sys/bus/pci/devices/*/reset to privileged administrators only

Patch Information

The fix reorders esw_apply_vport_rx_mode() ahead of esw_vport_change_handle_locked() in mlx5_esw_vport_disable() so that vport->allmulti_rule is NULL before the change handler observes it. The upstream fix is distributed across the following commits:

Workarounds

  • Disable SR-IOV on affected adapters where legacy E-Switch mode is in use, eliminating the vport disable path that triggers the bug
  • Switch E-Switch mode to switchdev where supported, which does not exercise the legacy FDB teardown logic
  • Suspend firmware-recovery triggers and schedule host reboots instead of in-place driver reloads until the patched kernel is deployed
bash
# Example: verify running kernel and mlx5_core version, then disable SR-IOV as a workaround
uname -r
modinfo mlx5_core | grep -E '^(version|srcversion)'
echo 0 | sudo tee /sys/class/net/<ifname>/device/sriov_numvfs

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.