netdevsim: fix UaF when counting Tx stats
Subsystems (3)
Jakub Kicinski
maintainerPATCH 1/1 netdevsim: fix UaF when counting Tx stats
skb may be freed as soon as we put it on the rx queue. Use the len variable like the code did prior to the conversion.
---
CC: [email protected]
CC: [email protected]
--- drivers/net/netdevsim/netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/netdevsim/netdev.c +1 -1
@@ -93,7 +93,7 @@ static netdev_tx_t nsim_start_xmit(struct sk_buff *skb, struct net_device *dev)hrtimer_start (&rq->napi_timer,us_to_ktime (5 ),HRTIMER_MODE_REL );rcu_read_unlock (); -dev_dstats_tx_add (dev, skb->len); +dev_dstats_tx_add (dev, len);return NETDEV_TX_OK ; out_drop_free:
Signature · 1 line
2.49.0
From: Jakub Kicinski <[email protected]>
Date: Fri, 20 Jun 2025 10:40:07 -0700
Quoted 5 lines
skb may be freed as soon as we put it on the rx queue. Use the len variable like the code did prior to the conversion.
Fixes f9e2511d80c2 ("netdevsim: migrate to dstats stats collection")Signed-off-by Jakub Kicinski <[email protected]>
Quoted 5 lines · Jakub Kicinski
skb may be freed as soon as we put it on the rx queue. Use the len variable like the code did prior to the conversion.
Fixes f9e2511d80c2 ("netdevsim: migrate to dstats stats collection")Signed-off-by Jakub Kicinski <[email protected]>
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Quoted 10 lines · On Fri, 20 Jun 2025 10:40:07 -0700 you wrote:
skb may be freed as soon as we put it on the rx queue. Use the len variable like the code did prior to the conversion.
Fixes f9e2511d80c2 ("netdevsim: migrate to dstats stats collection")Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected][...]
Here is the summary with links:
- [net-next] netdevsim: fix UaF when counting Tx stats
https://git.kernel.org/netdev/net-next/c/5e95c0a3a55a
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html