Skip to contentSkip to conversation

net: ethernet: lantiq_etop: fix double free in detach

PATCH Applied Aleksander Jan Bajkowski 2 participants 2 messages Jul 8, 2024 – Jul 10, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 net: ethernet: lantiq_etop: fix double free in detach

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

---
 drivers/net/ethernet/lantiq_etop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/lantiq_etop.c +2 -2
index 5352fee62d2b..0b9982804370 100644
@@ -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]);
 	}
 }
Signature · 1 line
2.39.2
#1 lore raw
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · 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.

[...]

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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html