]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
netdevsim: fix UaF when counting Tx stats
authorJakub Kicinski <kuba@kernel.org>
Fri, 20 Jun 2025 17:40:07 +0000 (10:40 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Jun 2025 17:50:23 +0000 (18:50 +0100)
commit5e95c0a3a55aea490420bd6994805edb050cc86b
treee27bbc40135d498ba0e8bdf8f99fd145c4f36582
parent14966a8df77e2dffdf765b56abe194aa6b0da325
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.

Fixes: f9e2511d80c2 ("netdevsim: migrate to dstats stats collection")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/netdev.c