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-98016 Overview
CVE-2026-98016 is a use-after-free race condition in the Linux kernel's Mellanox mlx5 Ethernet driver (net/mlx5e). The flaw lives in the sample_restore_put() function, which manages Traffic Control (TC) sample rule restore contexts. Concurrent teardown of TC sample rules that share the same restore context can re-read restore->count after restore_lock has been dropped. By that point, another thread may have already completed cleanup and freed the restore object, leaving the first thread operating on freed memory.
Critical Impact
Concurrent teardown paths may dereference a freed restore object, enabling kernel memory corruption and potential denial of service on systems using mlx5 Ethernet hardware with TC sample rules.
Affected Products
- Linux kernel builds including the net/mlx5e driver with TC sampling support
- Systems using Mellanox/NVIDIA ConnectX adapters with Traffic Control sample offload
- Distributions shipping affected mainline kernels prior to the referenced stable commits
Discovery Timeline
- 2026-09-25 - CVE-2026-98016 published to NVD
- 2026-09-25 - Last updated in NVD database
Technical Details for CVE-2026-98016
Vulnerability Analysis
The defect is a classic use-after-free triggered by a race between two kernel threads tearing down TC sample rules that share a restore context. The sample_restore_put() function decrements a reference count under restore_lock, releases the lock, and then re-reads restore->count to decide whether to free the object. Between the unlock and the subsequent read, a parallel teardown thread can observe the count reach zero, perform cleanup, and free the structure. The first thread then dereferences memory that no longer belongs to it.
This class of bug maps to [CWE-416] Use After Free combined with [CWE-362] Concurrent Execution Using Shared Resource with Improper Synchronization. The fix uses the value returned by the refcount decrement while still holding restore_lock, removing the dangerous re-read of freed state.
Root Cause
The synchronization pattern in sample_restore_put() violated the invariant that any field of a reference-counted object must only be examined while a valid reference is held. Dropping restore_lock before consulting restore->count allowed another CPU to complete the final put and free the allocation.
Attack Vector
Exploitation requires a local attacker or workload capable of installing and tearing down TC sample rules against an mlx5e interface, typically needing CAP_NET_ADMIN within the relevant network namespace. Rapid, concurrent creation and deletion of sample rules sharing a restore context is required to win the race. Successful exploitation corrupts kernel memory and can lead to kernel panics or, in more sophisticated attacks, controlled memory corruption.
The vulnerability mechanism is described in the upstream commits referenced below; see the Kernel Changes Commit 1daecd7 and Kernel Changes Commit af3aef0 for the authoritative patch diffs.
Detection Methods for CVE-2026-98016
Indicators of Compromise
- Kernel oops or panic messages referencing sample_restore_put, mlx5e, or the TC sample code path in dmesg and journal logs.
- KASAN (Kernel Address Sanitizer) reports flagging a use-after-free in the mlx5e sample restore routines on test or production kernels built with instrumentation.
- Unexpected reboots or interface resets on hosts using mlx5 adapters with heavy TC rule churn.
Detection Strategies
- Inventory running kernel versions against the fixed commits and flag hosts still exposing the vulnerable net/mlx5e code path.
- Audit workloads that programmatically add and remove TC sample rules, particularly orchestration layers managing SR-IOV or switchdev configurations.
- Enable CONFIG_KASAN and CONFIG_LOCKDEP in validation environments to surface the race during stress testing.
Monitoring Recommendations
- Forward dmesg and kern.log to a central logging platform and alert on crash signatures that mention mlx5 or sample_restore.
- Track tc filter and sample action churn as a telemetry signal for workloads that could trigger the race.
- Monitor NIC driver resets and link flaps that correlate with TC rule teardown activity.
How to Mitigate CVE-2026-98016
Immediate Actions Required
- Upgrade to a stable Linux kernel that incorporates the fix commits listed in the external references.
- Restrict CAP_NET_ADMIN to trusted administrators and limit container or namespace privileges that permit TC rule manipulation.
- Reduce concurrent teardown of TC sample rules sharing restore contexts in automation pipelines until patched kernels are deployed.
Patch Information
The upstream fix uses the value returned by the refcount decrement while restore_lock is still held, eliminating the stale read of restore->count. Patched kernels are available via the following stable commits: Kernel Changes Commit 1daecd7, Kernel Changes Commit 3efd1a1, Kernel Changes Commit 72324da, and Kernel Changes Commit af3aef0. Apply the distribution kernel update that incorporates these commits.
Workarounds
- Avoid using TC sample actions on mlx5e interfaces where feasible until the kernel is patched.
- Serialize TC rule teardown operations in orchestration tooling to reduce the likelihood of two threads racing on the same restore context.
- Deny CAP_NET_ADMIN to untrusted containers and workloads through seccomp, AppArmor, or SELinux policy.
# Verify the running kernel version and check for mlx5 driver usage
uname -r
lsmod | grep mlx5
# Example: restrict CAP_NET_ADMIN in a systemd unit
# /etc/systemd/system/<service>.d/override.conf
[Service]
CapabilityBoundingSet=~CAP_NET_ADMIN
AmbientCapabilities=
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

