mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v3] net: ethernet: lantiq_etop: fix double free in detach
@ 2024-07-08 20:58 Aleksander Jan Bajkowski
  2024-07-10  2:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Aleksander Jan Bajkowski @ 2024-07-08 20:58 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, jacob.e.keller, shannon.nelson,
	horms, sd, olek2, u.kleine-koenig, ralf, ralph.hempel, john,
	netdev, linux-kernel
  Cc: Joe Perches, Andrew Lunn

The number of the currently released descriptor is never incremented
which results in the same skb being released multiple times.

Fixes: 504d4721ee8e ("MIPS: Lantiq: Add ethernet driver")
Reported-by: Joe Perches <joe@perches.com>
Closes: https://lore.kernel.org/all/fc1bf93d92bb5b2f99c6c62745507cc22f3a7b2d.camel@perches.com/
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/ethernet/lantiq_etop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index 5352fee62d2b..0b9982804370 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -217,9 +217,9 @@ ltq_etop_free_channel(struct net_device *dev, struct ltq_etop_chan *ch)
 	if (ch->dma.irq)
 		free_irq(ch->dma.irq, priv);
 	if (IS_RX(ch->idx)) {
-		int desc;
+		struct ltq_dma_channel *dma = &ch->dma;
 
-		for (desc = 0; desc < LTQ_DESC_NUM; desc++)
+		for (dma->desc = 0; dma->desc < LTQ_DESC_NUM; dma->desc++)
 			dev_kfree_skb_any(ch->skb[ch->dma.desc]);
 	}
 }
-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net v3] net: ethernet: lantiq_etop: fix double free in detach
  2024-07-08 20:58 [PATCH net v3] net: ethernet: lantiq_etop: fix double free in detach Aleksander Jan Bajkowski
@ 2024-07-10  2:10 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-07-10  2:10 UTC (permalink / raw)
  To: Aleksander Jan Bajkowski
  Cc: davem, edumazet, kuba, pabeni, jacob.e.keller, shannon.nelson,
	horms, sd, u.kleine-koenig, ralf, ralph.hempel, john, netdev,
	linux-kernel, joe, andrew

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  8 Jul 2024 22:58:26 +0200 you wrote:
> The number of the currently released descriptor is never incremented
> which results in the same skb being released multiple times.
> 
> Fixes: 504d4721ee8e ("MIPS: Lantiq: Add ethernet driver")
> Reported-by: Joe Perches <joe@perches.com>
> Closes: https://lore.kernel.org/all/fc1bf93d92bb5b2f99c6c62745507cc22f3a7b2d.camel@perches.com/
> Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> 
> [...]

Here is the summary with links:
  - [net,v3] net: ethernet: lantiq_etop: fix double free in detach
    https://git.kernel.org/netdev/net/c/e1533b6319ab

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-07-10  2:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-08 20:58 [PATCH net v3] net: ethernet: lantiq_etop: fix double free in detach Aleksander Jan Bajkowski
2024-07-10  2: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

all inboxes | Powered by JetHome®