mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2025-12-06 20:54:00 -05:00
Prevents invalid flow table data from leaking across reboots Fixes: https://github.com/openwrt/openwrt/issues/19895 Signed-off-by: Felix Fietkau <nbd@nbd.name>
28 lines
826 B
Diff
28 lines
826 B
Diff
From: Felix Fietkau <nbd@nbd.name>
|
|
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 <nbd@nbd.name>
|
|
---
|
|
|
|
--- 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),
|