KernelScan.io

HIGH

netfilter Expectation Race

CVE-2026-43116

CVSS 7.8 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI6.4MEDIUM

01

In the Linux kernel, the following vulnerability has been resolved: netfilter: ctnetlink: ensure safe access to master conntrack Holding reference on the expectation is not sufficient, the master conntrack object can just go away, making exp->master invalid. To access exp->master safely: - Grab the nf_conntrack_expect_lock, this gets serialized with clean_from_lists() which also holds this lock when the master conntrack goes away. - Hold reference on master conntrack via nf_conntrack_find_get(). Not so easy since the master tuple to look up for the master conntrack is not available in the existing problematic paths. This patch goes for extending the nf_conntrack_expect_lock section to address this issue for simplicity, in the cases that are described below this is just slightly extending the lock section. The add expectation command already holds a reference to the master conntrack from ctnetlink_create_expect(). However, the delete expectation command needs to grab the spinlock before looking up for the expectation. Expand the existing spinlock section to address this to cover the expectation lookup. Note that, the nf_ct_expect_iterate_net() calls already grabs the spinlock while iterating over the expectation table, which is correct. The get expectation command needs to grab the spinlock to ensure master conntrack does not go away. This also expands the existing spinlock section to cover the expectation lookup too. I needed to move the netlink skb allocation out of the spinlock to keep it GFP_KERNEL. For the expectation events, the IPEXP_DESTROY event is already delivered under the spinlock, just move the delivery of IPEXP_NEW under the spinlock too because the master conntrack event cache is reached through exp->master. While at it, add lockdep notations to help identify what codepaths need to grab the spinlock.

02

Engine v0.2.0

Risk summary

A race condition in netfilter's ctnetlink interface allows the master conntrack object to be freed while still being accessed through expectation objects. This affects systems using connection tracking for network filtering and NAT. Exploitation requires CAP_NET_ADMIN privileges and precise timing but could lead to kernel memory corruption.

Affectednet/netfilter/nf_conntrack_netlink.c (netfilter)

Vulnerability analysis

The vulnerability stems from insufficient locking in the ctnetlink expectation handling code. While references are held on expectation objects, the master conntrack objects they point to can be freed concurrently by clean_from_lists(), creating a use-after-free condition when accessing exp->master. The fix extends the nf_conntrack_expect_lock spinlock sections to serialize access to master conntrack objects with the cleanup path, ensuring safe access to exp->master in get/delete expectation commands and event delivery.

03

BranchFixed inPatch commit
6.186.18.24f338ced04738
6.196.19.14497f99b26fff
mainline7.0bffcaad9afdf