CVE-2026-99294: netfilter: nft_fwd_netdev: use recursion counter in neigh egress path
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nft_fwd_netdev: use recursion counter in neigh egress path
nft_fwd_neigh can be used in egress chains (NF_NETDEV_EGRESS). When the forwarding rule targets the same device or two devices forward to each other, neigh_xmit() triggers dev_queue_xmit() which re-enters nf_hook_egress(), causing infinite recursion and stack overflow.
Move the nf_get_nf_dup_skb_recursion() accessor and NF_RECURSION_LIMIT to the shared header nf_dup_netdev.h as a static inline, so that nft_fwd_netdev can use the recursion counter directly without exported function call overhead. Guard neigh_xmit() with the same recursion limit already used in nf_do_netdev_egress().
[ Updated to cache the nf_get_nf_dup_skb_recursion pointer. --pablo ]
The Linux kernel CVE team has assigned CVE-2026-99294 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.17 with commit f87b9464d152f7705f1e37288dc48f5af6a2fc0c and fixed in 6.18.57 with commit fcacd948b10a351aa128acd3c2c4cee62d1ea677 Issue introduced in 5.17 with commit f87b9464d152f7705f1e37288dc48f5af6a2fc0c and fixed in 7.1 with commit 1d47b55b36d2ec73fe6901212c8b28a593c3b27c
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-99294
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:
include/net/netfilter/nf_dup_netdev.h
net/netfilter/nf_dup_netdev.c
net/netfilter/nft_fwd_netdev.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/fcacd948b10a351aa128acd3c2c4cee62d1ea677 https://git.kernel.org/stable/c/1d47b55b36d2ec73fe6901212c8b28a593c3b27c