* [PATCH net] octeontx2-pf: Add error handling to VLAN unoffload handling
@ 2024-06-17 16:50 Simon Horman
2024-06-19 11:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Simon Horman @ 2024-06-17 16:50 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep,
Hariprasad Kelam, Naveen Mamindlapalli, netdev
otx2_sq_append_skb makes used of __vlan_hwaccel_push_inside()
to unoffload VLANs - push them from skb meta data into skb data.
However, it omitts a check for __vlan_hwaccel_push_inside()
returning NULL.
Found by inspection based on [1] and [2].
Compile tested only.
[1] Re: [PATCH net-next v1] net: stmmac: Enable TSO on VLANs
https://lore.kernel.org/all/ZmrN2W8Fye450TKs@shell.armlinux.org.uk/
[2] Re: [PATCH net-next v2] net: stmmac: Enable TSO on VLANs
https://lore.kernel.org/all/CANn89i+11L5=tKsa7V7Aeyxaj6nYGRwy35PAbCRYJ73G+b25sg@mail.gmail.com/
Fixes: fd9d7859db6c ("octeontx2-pf: Implement ingress/egress VLAN offload")
Signed-off-by: Simon Horman <horms@kernel.org>
---
I audited callers of __vlan_hwaccel_push_inside in net
and this appears to be the only one that needs this fix.
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
index a16e9f244117..929b4eac25d9 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
@@ -1174,8 +1174,11 @@ bool otx2_sq_append_skb(struct net_device *netdev, struct otx2_snd_queue *sq,
if (skb_shinfo(skb)->gso_size && !is_hw_tso_supported(pfvf, skb)) {
/* Insert vlan tag before giving pkt to tso */
- if (skb_vlan_tag_present(skb))
+ if (skb_vlan_tag_present(skb)) {
skb = __vlan_hwaccel_push_inside(skb);
+ if (!skb)
+ return true;
+ }
otx2_sq_append_tso(pfvf, sq, skb, qidx);
return true;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] octeontx2-pf: Add error handling to VLAN unoffload handling
2024-06-17 16:50 [PATCH net] octeontx2-pf: Add error handling to VLAN unoffload handling Simon Horman
@ 2024-06-19 11:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-06-19 11:10 UTC (permalink / raw)
To: Simon Horman
Cc: davem, edumazet, kuba, pabeni, sgoutham, gakula, sbhatta, hkelam,
naveenm, netdev
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Mon, 17 Jun 2024 17:50:26 +0100 you wrote:
> otx2_sq_append_skb makes used of __vlan_hwaccel_push_inside()
> to unoffload VLANs - push them from skb meta data into skb data.
> However, it omitts a check for __vlan_hwaccel_push_inside()
> returning NULL.
>
> Found by inspection based on [1] and [2].
> Compile tested only.
>
> [...]
Here is the summary with links:
- [net] octeontx2-pf: Add error handling to VLAN unoffload handling
https://git.kernel.org/netdev/net/c/b95a4afe2def
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:[~2024-06-19 11:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-17 16:50 [PATCH net] octeontx2-pf: Add error handling to VLAN unoffload handling Simon Horman
2024-06-19 11:10 ` 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).