]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
netfilter: nft_flow_offload: zero device address for non-ether case
authorFlorian Westphal <fw@strlen.de>
Thu, 18 Jun 2026 06:25:47 +0000 (08:25 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 20 Jun 2026 22:18:27 +0000 (00:18 +0200)
LLM points out that the skip causes unitialised stack array to
propagate down into dev_fill_forward_path().  Its not clear to me that
there is a guarantee that a later ctx.dev->netdev_ops->ndo_fill_forward_path()
would always fix this up.

Cc: Felix Fietkau <nbd@nbd.name>
Fixes: 45ca3e61999e ("netfilter: nft_flow_offload: skip dst neigh lookup for ppp devices")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_flow_table_path.c

index 1e7e216b9f8945a05cbb3d29ffb945d82cd928d3..98c03b487f52110f052858da7d7ab7024c5d559b 100644 (file)
@@ -53,8 +53,10 @@ static int nft_dev_fill_forward_path(const struct nf_flow_route *route,
        struct neighbour *n;
        u8 nud_state;
 
-       if (!nft_is_valid_ether_device(dev))
+       if (!nft_is_valid_ether_device(dev)) {
+               eth_zero_addr(ha);
                goto out;
+       }
 
        n = dst_neigh_lookup(dst_cache, daddr);
        if (!n)