CVE-2026-98851: netfilter: nft_flow_offload: drop flowtable reference on init error path
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nft_flow_offload: drop flowtable reference on init error path
nft_flow_offload_init() bumps the flowtable use count with nft_use_inc() before calling nf_ct_netns_get(). When the latter fails, the error is returned as-is and the reference is leaked.
The upper layers do not balance it either: nf_tables_newexpr() clears expr->ops when the expression init callback fails, so the nft_expr_more() iteration in nft_rule_expr_deactivate() and nf_tables_rule_destroy() stops right before the failed expression and its ->destroy callback, which would drop the reference, never runs.
Each failed rule addition therefore leaks one flowtable reference and the flowtable can no longer be removed: NFT_MSG_DELFLOWTABLE keeps reporting -EBUSY even though no rule references it.
Save the nf_ct_netns_get() return value and undo the nft_use_inc() when it fails, restoring the inc/dec pairing within nft_flow_offload_init() itself.
The Linux kernel CVE team has assigned CVE-2026-98851 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.16 with commit a3c90f7a2323b331ae816d5b0633e68148e25d04 and fixed in 6.12.113 with commit 64ac0cb574c740bf723affb79b646eeba920db6b Issue introduced in 4.16 with commit a3c90f7a2323b331ae816d5b0633e68148e25d04 and fixed in 6.18.56 with commit c5f91098edee98c015f78488460a0609e62582a5 Issue introduced in 4.16 with commit a3c90f7a2323b331ae816d5b0633e68148e25d04 and fixed in 7.2.10 with commit 4cd378423a33194a773c267fc58606d28fce95cf Issue introduced in 4.16 with commit a3c90f7a2323b331ae816d5b0633e68148e25d04 and fixed in 7.3-rc6 with commit 747928b5d4ff8c8de55138a54c13980e4bb88578
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-98851
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
net/netfilter/nft_flow_offload.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/64ac0cb574c740bf723affb79b646eeba920db6b https://git.kernel.org/stable/c/c5f91098edee98c015f78488460a0609e62582a5 https://git.kernel.org/stable/c/4cd378423a33194a773c267fc58606d28fce95cf https://git.kernel.org/stable/c/747928b5d4ff8c8de55138a54c13980e4bb88578