Przeglądaj źródła

kernel: mtk_eth_soc: zero-initialize PPE flow tables

Prevents invalid flow table data from leaking across reboots

Fixes: https://github.com/openwrt/openwrt/issues/19895
Signed-off-by: Felix Fietkau <[email protected]>
(cherry picked from commit 36d0690993ba90321fd0c004e5f3c66ac10966ee)
Felix Fietkau 3 miesięcy temu
rodzic
commit
05e6fe692b

+ 27 - 0
target/linux/generic/pending-6.6/736-05-net-ethernet-mtk_eth_soc-zero-initialize-PPE-flow-ta.patch

@@ -0,0 +1,27 @@
+From: Felix Fietkau <[email protected]>
+Date: Fri, 12 Sep 2025 14:18:14 +0200
+Subject: [PATCH] net: ethernet: mtk_eth_soc: zero initialize PPE flow table
+
+Avoid picking up flows from last boot or other invalid data
+
+Signed-off-by: Felix Fietkau <[email protected]>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
++++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
+@@ -914,6 +914,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
+ 	if (!foe)
+ 		goto err_free_l2_flows;
+ 
++	memset(foe, 0, MTK_PPE_ENTRIES * soc->foe_entry_size);
+ 	ppe->foe_table = foe;
+ 
+ 	foe_flow_size = (MTK_PPE_ENTRIES / soc->hash_offset) *
+@@ -928,6 +929,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
+ 		if (!mib)
+ 			return NULL;
+ 
++		memset(mib, 0, MTK_PPE_ENTRIES * sizeof(*mib));
+ 		ppe->mib_table = mib;
+ 
+ 		acct = devm_kzalloc(dev, MTK_PPE_ENTRIES * sizeof(*acct),