* [PATCH net] net: ethernet: mtk_eth_soc: check max allowed hash in mtk_ppe_check_skb
@ 2022-09-05 12:41 Lorenzo Bianconi
2022-09-07 15:00 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Bianconi @ 2022-09-05 12:41 UTC (permalink / raw)
To: netdev
Cc: nbd, john, sean.wang, Mark-MC.Lee, davem, edumazet, kuba, pabeni,
matthias.bgg, linux-mediatek, lorenzo.bianconi
Even if max hash configured in hw in mtk_ppe_hash_entry is
MTK_PPE_ENTRIES - 1, check theoretical OOB accesses in
mtk_ppe_check_skb routine
Fixes: c4f033d9e03e9 ("net: ethernet: mtk_eth_soc: rework hardware flow table management")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/ethernet/mediatek/mtk_ppe.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.h b/drivers/net/ethernet/mediatek/mtk_ppe.h
index 1f5cf1c9a947..69ffce04d630 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
@@ -293,6 +293,9 @@ mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash)
if (!ppe)
return;
+ if (hash > MTK_PPE_HASH_MASK)
+ return;
+
now = (u16)jiffies;
diff = now - ppe->foe_check_time[hash];
if (diff < HZ / 10)
--
2.37.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: ethernet: mtk_eth_soc: check max allowed hash in mtk_ppe_check_skb
2022-09-05 12:41 [PATCH net] net: ethernet: mtk_eth_soc: check max allowed hash in mtk_ppe_check_skb Lorenzo Bianconi
@ 2022-09-07 15:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-07 15:00 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: netdev, nbd, john, sean.wang, Mark-MC.Lee, davem, edumazet, kuba,
pabeni, matthias.bgg, linux-mediatek, lorenzo.bianconi
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Mon, 5 Sep 2022 14:41:28 +0200 you wrote:
> Even if max hash configured in hw in mtk_ppe_hash_entry is
> MTK_PPE_ENTRIES - 1, check theoretical OOB accesses in
> mtk_ppe_check_skb routine
>
> Fixes: c4f033d9e03e9 ("net: ethernet: mtk_eth_soc: rework hardware flow table management")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>
> [...]
Here is the summary with links:
- [net] net: ethernet: mtk_eth_soc: check max allowed hash in mtk_ppe_check_skb
https://git.kernel.org/netdev/net/c/f27b405ef433
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-07 15:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-05 12:41 [PATCH net] net: ethernet: mtk_eth_soc: check max allowed hash in mtk_ppe_check_skb Lorenzo Bianconi
2022-09-07 15:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).