* [PATCH net v2] net: dsa: tag_ocelot_8021q: fix broken reception
@ 2024-12-11 14:47 Robert Hodaszi
2024-12-11 14:52 ` Vladimir Oltean
2024-12-12 15:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Robert Hodaszi @ 2024-12-11 14:47 UTC (permalink / raw)
To: netdev, vladimir.oltean, claudiu.manoil, alexandre.belloni,
UNGLinuxDriver, andrew, davem, edumazet, kuba, pabeni, horms,
linux-kernel
Cc: Robert Hodaszi, stable
The blamed commit changed the dsa_8021q_rcv() calling convention to
accept pre-populated source_port and switch_id arguments. If those are
not available, as in the case of tag_ocelot_8021q, the arguments must be
pre-initialized with -1.
Due to the bug of passing uninitialized arguments in tag_ocelot_8021q,
dsa_8021q_rcv() does not detect that it needs to populate the
source_port and switch_id, and this makes dsa_conduit_find_user() fail,
which leads to packet loss on reception.
Fixes: dcfe7673787b ("net: dsa: tag_sja1105: absorb logic for not overwriting precise info into dsa_8021q_rcv()")
Signed-off-by: Robert Hodaszi <robert.hodaszi@digi.com>
---
Cc: stable@vger.kernel.org
---
net/dsa/tag_ocelot_8021q.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/dsa/tag_ocelot_8021q.c b/net/dsa/tag_ocelot_8021q.c
index 8e8b1bef6af6..11ea8cfd6266 100644
--- a/net/dsa/tag_ocelot_8021q.c
+++ b/net/dsa/tag_ocelot_8021q.c
@@ -79,7 +79,7 @@ static struct sk_buff *ocelot_xmit(struct sk_buff *skb,
static struct sk_buff *ocelot_rcv(struct sk_buff *skb,
struct net_device *netdev)
{
- int src_port, switch_id;
+ int src_port = -1, switch_id = -1;
dsa_8021q_rcv(skb, &src_port, &switch_id, NULL, NULL);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] net: dsa: tag_ocelot_8021q: fix broken reception
2024-12-11 14:47 [PATCH net v2] net: dsa: tag_ocelot_8021q: fix broken reception Robert Hodaszi
@ 2024-12-11 14:52 ` Vladimir Oltean
2024-12-12 15:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Oltean @ 2024-12-11 14:52 UTC (permalink / raw)
To: Robert Hodaszi
Cc: netdev, claudiu.manoil, alexandre.belloni, UNGLinuxDriver, andrew,
davem, edumazet, kuba, pabeni, horms, linux-kernel, stable
On Wed, Dec 11, 2024 at 03:47:41PM +0100, Robert Hodaszi wrote:
> The blamed commit changed the dsa_8021q_rcv() calling convention to
> accept pre-populated source_port and switch_id arguments. If those are
> not available, as in the case of tag_ocelot_8021q, the arguments must be
> pre-initialized with -1.
>
> Due to the bug of passing uninitialized arguments in tag_ocelot_8021q,
> dsa_8021q_rcv() does not detect that it needs to populate the
> source_port and switch_id, and this makes dsa_conduit_find_user() fail,
> which leads to packet loss on reception.
>
> Fixes: dcfe7673787b ("net: dsa: tag_sja1105: absorb logic for not overwriting precise info into dsa_8021q_rcv()")
> Signed-off-by: Robert Hodaszi <robert.hodaszi@digi.com>
> ---
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] net: dsa: tag_ocelot_8021q: fix broken reception
2024-12-11 14:47 [PATCH net v2] net: dsa: tag_ocelot_8021q: fix broken reception Robert Hodaszi
2024-12-11 14:52 ` Vladimir Oltean
@ 2024-12-12 15:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-12-12 15:30 UTC (permalink / raw)
To: Robert Hodaszi
Cc: netdev, vladimir.oltean, claudiu.manoil, alexandre.belloni,
UNGLinuxDriver, andrew, davem, edumazet, kuba, pabeni, horms,
linux-kernel, stable
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 11 Dec 2024 15:47:41 +0100 you wrote:
> The blamed commit changed the dsa_8021q_rcv() calling convention to
> accept pre-populated source_port and switch_id arguments. If those are
> not available, as in the case of tag_ocelot_8021q, the arguments must be
> pre-initialized with -1.
>
> Due to the bug of passing uninitialized arguments in tag_ocelot_8021q,
> dsa_8021q_rcv() does not detect that it needs to populate the
> source_port and switch_id, and this makes dsa_conduit_find_user() fail,
> which leads to packet loss on reception.
>
> [...]
Here is the summary with links:
- [net,v2] net: dsa: tag_ocelot_8021q: fix broken reception
https://git.kernel.org/netdev/net/c/36ff681d2283
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] 3+ messages in thread
end of thread, other threads:[~2024-12-12 15:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11 14:47 [PATCH net v2] net: dsa: tag_ocelot_8021q: fix broken reception Robert Hodaszi
2024-12-11 14:52 ` Vladimir Oltean
2024-12-12 15:30 ` 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).