Skip to contentSkip to conversation

netfilter: nft_flow_offload: zero device address for non-ether case

PATCH New Florian Westphal 1 participant 1 message Jun 18

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nft_flow_offload: zero device address for non-ether case

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 <[email protected]>
Fixes 45ca3e61999e ("netfilter: nft_flow_offload: skip dst neigh lookup for ppp devices")

---
Please consider this a bug report, its possible this patch is junk.

 net/netfilter/nf_flow_table_path.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/netfilter/nf_flow_table_path.c +3 -1
index 9e88ea6a2eef..c0b07dde0434 100644
@@ -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)
Signature · 1 line
2.53.0