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

CVE-2026-97608: Linux Kernel Netfilter Race Condition

CVE-2026-97608 is a race condition flaw in the Linux kernel netfilter subsystem that can lead to use-after-free conditions during logger unregistration. This post explains its impact, affected versions, and mitigation steps.

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

CVE-2026-97608 is a race condition in the Linux kernel netfilter subsystem. The flaw affects the nf_log_syslog and nfnetlink_log backends. Both components unregister per-network namespace operations before unregistering their global logger backends. This ordering creates a window where a sysctl or netlink writer can rebind a still-registered logger after the per-net pre-exit callback cleared the previous selection. A subsequent sysctl read or packet logging operation can then dereference a stale per-net logger pointer referencing freed module memory.

Critical Impact

Local attackers with the ability to trigger logger (re)binding during network namespace teardown can trigger a use-after-free, leading to kernel memory corruption, denial of service, or local privilege escalation.

Affected Products

  • Linux kernel netfilter subsystem (nf_log_syslog)
  • Linux kernel netfilter subsystem (nfnetlink_log)
  • Linux distributions shipping affected mainline kernel versions prior to the referenced stable commits

Discovery Timeline

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

Technical Details for CVE-2026-97608

Vulnerability Analysis

The vulnerability is a time-of-check to time-of-use (TOCTOU) race between network namespace teardown and logger (re)binding. During unregister_pernet_subsys(), the nf_log_unset() callback clears net->nf.nf_loggers[pf] on CPU 0. Before CPU 0 proceeds to call nf_log_unregister(), a concurrent writer on CPU 1 can acquire nf_log_mutex, locate the still-registered backend in the global loggers[][] table, and reassign net->nf.nf_loggers[pf] to that logger.

After the race, CPU 0 completes nf_log_unregister(), waits for an RCU grace period, and the module is unloaded. The backend's memory is freed, but the per-net pointer on CPU 1 still references the released code. Later packet logging or sysctl reads dereference the stale pointer, producing a kernel use-after-free condition.

Root Cause

The root cause is an incorrect teardown ordering between global and per-net state. The nf_log_syslog and nfnetlink_log backends removed per-net registrations before deregistering the global logger table entries. This left the global logger discoverable to writers after per-net cleanup had already run, violating the invariant that no new binding could occur during teardown.

Attack Vector

Exploitation requires local access and the ability to write to netfilter logger selection interfaces (sysctl under /proc/sys/net/netfilter/nf_log/ or netlink). An attacker in a user namespace with CAP_NET_ADMIN over a target netns can race namespace teardown with a logger-rebind write. Successful exploitation enables arbitrary kernel pointer dereference once the backend module is unloaded.

No verified public code examples are available. See the upstream fix commits for the exact ordering change: Kernel Git Commit 2c018cc, Kernel Git Commit 64803ba, Kernel Git Commit dce24f3, and Kernel Git Commit eaec35f.

Detection Methods for CVE-2026-97608

Indicators of Compromise

  • Unexpected kernel oops or general protection fault entries in dmesg referencing nf_log_packet, nf_log_syslog, or nfnetlink_log symbols.
  • KASAN reports flagging use-after-free in the netfilter logging path during or after network namespace teardown.
  • Kernel panics correlated in time with container shutdown, netns deletion, or rmmod nf_log_syslog/rmmod nfnetlink_log operations.

Detection Strategies

  • Monitor kernel crash dumps and kdump artifacts for stack traces involving nf_log_bind_pf, nf_log_unset, or __nf_log_unregister.
  • Audit module load/unload events for nf_log_syslog and nfnetlink_log on multi-tenant hosts and container nodes.
  • Enable kernel lockdep and KASAN on test infrastructure to surface the race under fuzzing workloads such as syzkaller.

Monitoring Recommendations

  • Collect kernel logs centrally and alert on repeated oops signatures tied to netfilter logging functions.
  • Track processes with CAP_NET_ADMIN writing to /proc/sys/net/netfilter/nf_log/* and correlate with concurrent unshare or namespace deletion.
  • Baseline the frequency of network namespace creation and teardown on hosts running untrusted workloads.

How to Mitigate CVE-2026-97608

Immediate Actions Required

  • Apply the stable kernel updates containing the four referenced commits that reorder global logger deregistration before per-net teardown.
  • Restrict CAP_NET_ADMIN and user namespace creation for untrusted local users where feasible, using kernel.unprivileged_userns_clone=0 or equivalent.
  • Prioritize patching multi-tenant hosts, container runtimes, and systems where unprivileged users can create network namespaces.

Patch Information

The fix reorders teardown so that nf_log_unregister() runs before unregister_pernet_subsys() in both backends. Once the global registration is gone, concurrent writers can no longer locate and rebind the logger. The RCU grace period inside unregister_pernet_subsys() then safely drains remaining readers. Apply the upstream commits 2c018cc, 64803ba, dce24f3, and eaec35f, or upgrade to a distribution kernel that incorporates them.

Workarounds

  • Avoid loading nf_log_syslog and nfnetlink_log on hosts where they are not required; prefer nft meta-logging without these backends.
  • Blacklist the affected modules via /etc/modprobe.d/ on systems that do not depend on per-protocol netfilter logging.
  • Disable unprivileged user namespaces to remove the practical path for unprivileged local attackers to trigger the race.
bash
# Configuration example: disable unprivileged user namespaces and blacklist unused loggers
sysctl -w kernel.unprivileged_userns_clone=0
echo 'kernel.unprivileged_userns_clone=0' > /etc/sysctl.d/99-cve-2026-97608.conf

cat > /etc/modprobe.d/blacklist-nf_log.conf <<'EOF'
blacklist nf_log_syslog
blacklist nfnetlink_log
EOF

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.