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

CVE-2026-98625: Linux Kernel Netfilter Use-After-Free

CVE-2026-98625 is a use-after-free flaw in the Linux kernel netfilter flowtable component that can lead to memory corruption. This post 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-98625 Overview

CVE-2026-98625 is a use-after-free vulnerability in the Linux kernel's netfilter flowtable hardware offload subsystem. The flaw arises from an ordering bug in flow_offload_work_del(), which publishes the NF_FLOW_HW_DEAD flag before the work handler clears NF_FLOW_HW_PENDING. Once a flow carries both HW_DYING and HW_DEAD, a concurrent garbage collection pass can remove it and queue it for RCU freeing while the offload worker still holds a raw pointer. The worker lacks both an RCU read-side lock and an explicit flow reference, so a preemption after publishing HW_DEAD can let the RCU callback free the flow before the worker resumes.

Critical Impact

A race between the netfilter flowtable offload worker and the garbage collector can trigger a kernel-mode use-after-free, enabling memory corruption and potential privilege escalation on systems using hardware flow offload.

Affected Products

  • Linux kernel versions containing the netfilter flowtable hardware offload code path prior to the fix commits
  • Distributions shipping the vulnerable net/netfilter/nf_flow_table_offload.c logic
  • Systems with netfilter flowtable hardware offload enabled on supported NICs

Discovery Timeline

  • 2026-10-18 - CVE-2026-98625 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-98625

Vulnerability Analysis

The netfilter flowtable subsystem offloads established connections to hardware for accelerated packet forwarding. Each flow entry tracks its offload state through bitflags including NF_FLOW_HW_PENDING, NF_FLOW_HW_DYING, and NF_FLOW_HW_DEAD. The garbage collector uses these flags to decide when a flow is safe to detach from the flowtable and free via an RCU callback.

The defect is a publication-ordering bug. flow_offload_work_del() sets NF_FLOW_HW_DEAD at the start of the destroy work, before the offload worker finishes its remaining accesses and clears NF_FLOW_HW_PENDING. Between these two events, the flow is observable as both dying and dead. A concurrent garbage collection pass may legitimately remove the entry and schedule its RCU freeing while the worker still holds a dangling pointer.

Root Cause

The worker thread does not hold an rcu_read_lock() across its flow accesses and does not take a reference on the flow object. Publishing NF_FLOW_HW_DEAD early effectively grants the garbage collector permission to free the flow while the worker is still reading or writing it. If the worker is preempted between publishing HW_DEAD and clearing HW_PENDING, the RCU grace period can elapse and the flow can be freed. When the worker resumes to clear HW_PENDING or touch other fields, it operates on freed memory.

Attack Vector

Triggering the race requires generating conflict between flow destruction and the periodic garbage collection pass on a system with hardware flow offload enabled. A local workload that rapidly creates and tears down connections tracked by flowtable offload can increase the probability of the race window. Successful exploitation corrupts kernel memory and may be chained toward privilege escalation. No remote precondition is documented in the advisory, and no public exploit is referenced.

The upstream fix moves NF_FLOW_HW_DEAD publication to the common worker epilogue, after NF_FLOW_HW_PENDING is cleared. This ensures HW_DEAD is the final write on the flow by destroy work and that all preceding accesses are ordered before garbage collection is permitted to free the object. Patch details are available in the referenced kernel commits, including Kernel Commit b0ef9450 and Kernel Commit f26652e9.

Detection Methods for CVE-2026-98625

Indicators of Compromise

  • Kernel oops or general protection fault traces referencing flow_offload_work_handler or nf_flow_offload_work_del in the call stack
  • KASAN use-after-free reports pointing to struct flow_offload allocations freed via RCU
  • Unexpected kernel panics on hosts with netfilter flowtable hardware offload enabled under high connection churn

Detection Strategies

  • Audit running kernel versions against the fix commits listed in the advisory and flag hosts still on vulnerable builds
  • Enable KASAN in test environments to surface the use-after-free deterministically during fuzzing of flowtable teardown paths
  • Correlate kernel ring buffer messages (dmesg) with workloads that create and destroy large numbers of offloaded flows

Monitoring Recommendations

  • Centralize /var/log/kern.log and journalctl -k output to a SIEM for pattern matching on netfilter stack traces
  • Monitor for repeated unexpected reboots on routers, firewalls, and gateways using nft flowtable offload
  • Track kernel package versions across the fleet and alert when hosts deviate from the patched baseline

How to Mitigate CVE-2026-98625

Immediate Actions Required

  • Apply the stable kernel update that includes the ordering fix for NF_FLOW_HW_DEAD publication
  • Inventory systems using netfilter flowtable hardware offload and prioritize them for patching
  • If patching cannot be scheduled immediately, disable hardware flow offload on exposed hosts

Patch Information

The fix is distributed across multiple stable branches. See the upstream references: Kernel Commit 00e452a7, Kernel Commit 56f39c7d, Kernel Commit b0ef9450, Kernel Commit b4f0f05d, Kernel Commit d644b23a, Kernel Commit e2070184, Kernel Commit f26652e9, and Kernel Commit f92e8f39. Rebuild and reboot into the patched kernel to activate the corrected ordering.

Workarounds

  • Remove flowtable offload rules from nftables rulesets until the patched kernel is installed
  • Avoid the flags offload directive on flowtable definitions on affected hosts
  • Restrict local account access on affected systems to reduce the ability to generate the required flow churn
bash
# Example: remove hardware offload from an nftables flowtable definition
# Before (vulnerable configuration):
#   table inet filter {
#       flowtable ft {
#           hook ingress priority 0
#           devices = { eth0, eth1 }
#           flags offload
#       }
#   }

# After (workaround — software path only):
nft -f - <<'EOF'
table inet filter {
    flowtable ft {
        hook ingress priority 0
        devices = { eth0, eth1 }
    }
}
EOF

# Verify no offload flag is present
nft list flowtables

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.