HIGH Introduced in 3.10
netfilter Logger UAF
CVE-2026-97608
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.0HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: netfilter: nf_log: unregister loggers before per-net teardown nf_log_syslog and nfnetlink_log unregister their per-network namespace operations before unregistering their global logger backends. This leaves a window where a sysctl or netlink writer can rebind the still- registered logger after the per-net pre-exit callback cleared the old selection. The race looks like this: CPU 0 CPU 1 ---- ---- unregister_pernet_subsys() nf_log_unset(net, logger) net->nf.nf_loggers[pf] = NULL lock nf_log_mutex find logger in loggers[][] net->nf.nf_loggers[pf] = logger unlock nf_log_mutex nf_log_unregister(logger) lock nf_log_mutex loggers[pf][type] = NULL unlock nf_log_mutex synchronize_rcu() module exit returns module core frees backend memory Later, a sysctl read or packet logging operation can dereference the stale per-net logger pointer. Fix this by unregistering the global logger backends before tearing down per-net state. Once the global registrations are gone, later writers can no longer rebind the logger. unregister_pernet_subsys() already waits for an RCU grace period after the pre-exit callback clears the per-net selection, while nf_log_unregister() continues to cover readers of the global logger table. Apply this ordering fix to both nf_log backends that combine per-net teardown with global logger registration.
02KernelScan AI Analysis
Risk summary
A race condition in the netfilter logging subsystem's module teardown path leaves a dangling per-network-namespace logger pointer that is later dereferenced, causing a use-after-free. An attacker with local access and CAP_NET_ADMIN (obtainable in a user namespace) must time a sysctl or netlink rebind to coincide with the module's exit sequence, which itself requires privileged module removal. The freed memory can be reclaimed and corrupted, enabling potential kernel code execution or crash.
Vulnerability analysis
During module teardown, the netfilter logging subsystem clears per-network-namespace logger selections before unregistering the global logger entries, leaving a brief window where a concurrent sysctl or netlink writer can rebind the still-registered logger into a namespace whose selection was just cleared. After the module finishes unloading and frees its backend memory, that rebind leaves a dangling per-net pointer that is later dereferenced by packet-logging or sysctl read operations, resulting in a use-after-free. The fix reverses the teardown order so the global logger entries are removed first, preventing any new rebinds before per-net state is torn down; the existing RCU grace period in the pernet subsystem exit then covers any in-flight readers. An attacker needs local access with CAP_NET_ADMIN — obtainable inside a user namespace on most distros — and must win a race against the module exit path.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.15 | 3.10 | 5.15.222 | 51417230716b |
| 6.1 | 3.10 | 6.1.189 | b0514ca1ee6f |
| 6.6 | 3.10 | 6.6.158 | 90166834b7dc |
| 6.12 | 3.10 | 6.12.111 | eaec35fae8f2 |
| 6.18 | 3.10 | 6.18.53 | 64803ba0a057 |
| 7.2 | 3.10 | 7.2.7 | dce24f3a1469 |
| mainline | 3.10 | 7.3-rc3 | 2c018cc4842c |
| cip/6.12 | 3.10 | 6.12.111-cip32 | eaec35fae8f2 |