[openwrt/openwrt] kernel: mtk_eth_soc: zero-initialize PPE flow tables
LEDE Commits
lede-commits at lists.infradead.org
Fri Sep 12 05:40:41 PDT 2025
nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/36d0690993ba90321fd0c004e5f3c66ac10966ee
commit 36d0690993ba90321fd0c004e5f3c66ac10966ee
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Sep 12 14:39:48 2025 +0200
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 <nbd at nbd.name>
---
...t-mtk_eth_soc-zero-initialize-PPE-flow-ta.patch | 27 ++++++++++++++++++++++
...t-mtk_eth_soc-zero-initialize-PPE-flow-ta.patch | 27 ++++++++++++++++++++++
2 files changed, 54 insertions(+)
diff --git a/target/linux/generic/pending-6.12/736-05-net-ethernet-mtk_eth_soc-zero-initialize-PPE-flow-ta.patch b/target/linux/generic/pending-6.12/736-05-net-ethernet-mtk_eth_soc-zero-initialize-PPE-flow-ta.patch
new file mode 100644
index 0000000000..2ca5ace367
--- /dev/null
+++ b/target/linux/generic/pending-6.12/736-05-net-ethernet-mtk_eth_soc-zero-initialize-PPE-flow-ta.patch
@@ -0,0 +1,27 @@
+From: Felix Fietkau <nbd at 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 at 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),
diff --git a/target/linux/generic/pending-6.6/736-05-net-ethernet-mtk_eth_soc-zero-initialize-PPE-flow-ta.patch b/target/linux/generic/pending-6.6/736-05-net-ethernet-mtk_eth_soc-zero-initialize-PPE-flow-ta.patch
new file mode 100644
index 0000000000..2ca5ace367
--- /dev/null
+++ b/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 <nbd at 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 at 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),
More information about the lede-commits
mailing list