diff options
author | Felix Fietkau <nbd@nbd.name> | 2022-09-20 11:32:51 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-09-20 12:08:26 +0200 |
commit | 0a7269584478e164ff185864292452af35abec1b (patch) | |
tree | bda846bdc9b8059bccd7e551c824b51f5116dfeb /target/linux/generic/backport-5.15/711-v6.0-02-net-ethernet-mtk_ppe-fix-possible-NULL-pointer-deref.patch | |
parent | 3cee396bf86f0aa9ef9746b7824dd3307b56e9c3 (diff) | |
download | upstream-0a7269584478e164ff185864292452af35abec1b.tar.gz upstream-0a7269584478e164ff185864292452af35abec1b.tar.bz2 upstream-0a7269584478e164ff185864292452af35abec1b.zip |
kernel: backport MTK ethernet/WLAN offload fixes
Fixes issues with offloading to WED, especially with VLAN bridges involved
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/generic/backport-5.15/711-v6.0-02-net-ethernet-mtk_ppe-fix-possible-NULL-pointer-deref.patch')
-rw-r--r-- | target/linux/generic/backport-5.15/711-v6.0-02-net-ethernet-mtk_ppe-fix-possible-NULL-pointer-deref.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.15/711-v6.0-02-net-ethernet-mtk_ppe-fix-possible-NULL-pointer-deref.patch b/target/linux/generic/backport-5.15/711-v6.0-02-net-ethernet-mtk_ppe-fix-possible-NULL-pointer-deref.patch new file mode 100644 index 0000000000..fc6e246468 --- /dev/null +++ b/target/linux/generic/backport-5.15/711-v6.0-02-net-ethernet-mtk_ppe-fix-possible-NULL-pointer-deref.patch @@ -0,0 +1,27 @@ +From: Lorenzo Bianconi <lorenzo@kernel.org> +Date: Mon, 18 Jul 2022 11:51:53 +0200 +Subject: [PATCH] net: ethernet: mtk_ppe: fix possible NULL pointer dereference + in mtk_flow_get_wdma_info + +odev pointer can be NULL in mtk_flow_offload_replace routine according +to the flower action rules. Fix possible NULL pointer dereference in +mtk_flow_get_wdma_info. + +Fixes: a333215e10cb5 ("net: ethernet: mtk_eth_soc: implement flow offloading to WED devices") +Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> +Link: https://lore.kernel.org/r/4e1685bc4976e21e364055f6bee86261f8f9ee93.1658137753.git.lorenzo@kernel.org +Signed-off-by: Jakub Kicinski <kuba@kernel.org> +--- + +--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c ++++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c +@@ -93,6 +93,9 @@ mtk_flow_get_wdma_info(struct net_device + }; + struct net_device_path path = {}; + ++ if (!ctx.dev) ++ return -ENODEV; ++ + memcpy(ctx.daddr, addr, sizeof(ctx.daddr)); + + if (!IS_ENABLED(CONFIG_NET_MEDIATEK_SOC_WED)) |