KernelScan.io

HIGH Introduced in 5.7

netfilter NFTables Deref

CVE-2026-90061

CVSS 7.8 / 10.0 KernelScan AI

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

01

In the Linux kernel, the following vulnerability has been resolved: netfilter: nf_tables: skip double clone set expressions on element insert Both the dynset and newsetelem path clone the existing set expressions when setting set element expressions if no override expressions are provided. This results in a double clone, once to clone the template set expressions then another clone on the new element. Add a flag to annotate if userspace provides a override expression (ie. expression of the same type of the set but different configuration), otherwise borrow the existing expression from the set. Add conditionals to release expression iif they represent an override. Use this new override_exprs flag to dump the dynset expression override to userspace. This simplifies the existing logic and it also fixes a bug with the connlimit expression which results in a module refcount imbalance WARNING splat when resorting on the default set expressions.

02

Engine v0.6.0

Risk summary

A logic error in the nf_tables subsystem causes a double-clone of set expressions when inserting elements without override expressions. This leads to a module reference count imbalance and can result in a use-after-free on the expression object, potentially causing a kernel panic or memory corruption. An attacker with CAP_NET_ADMIN (obtainable in a user namespace) can trigger this via netlink.

Affectednet/netfilter/nf_tables_api.c, net/netfilter/nft_dynset.c (netfilter)

Vulnerability analysis

When inserting a set element without providing override expressions, the code unnecessarily cloned the set's default expressions twice—once for the template and again for the new element. This extra cloning threw off reference counting on stateful objects and could corrupt memory when the duplicated objects were later freed. The fix distinguishes whether userspace provided its own override expressions: if not, the element now borrows the existing set expressions directly instead of making redundant copies, and cleanup only destroys expressions that were actually provided by the user. Any local process with CAP_NET_ADMIN can trigger this through the netfilter netlink interface; on standard kernels that capability is available inside unprivileged user namespaces.

03

BranchIntroducedFixed inPatch commit
7.25.77.2.61e7fb6801d9c
mainline5.77.3-rc143559058d21e