Skip to content
Commit 0a819ba2 authored by Pavel Belous's avatar Pavel Belous Committed by Greg Kroah-Hartman
Browse files

net: atlantic: fix use after free kasan warn

commit a4980919 upstream.

skb->len is used to calculate statistics after xmit invocation.

Under a stress load it may happen that skb will be xmited,
rx interrupt will come and skb will be freed, all before xmit function
is even returned.

Eventually, skb->len will access unallocated area.

Moving stats calculation into tx_clean routine.

Fixes: 018423e9

 ("net: ethernet: aquantia: Add ring support code")
Reported-by: default avatarChristophe Vu-Brugier <cvubrugier@fastmail.fm>
Signed-off-by: default avatarIgor Russkikh <irusskikh@marvell.com>
Signed-off-by: default avatarPavel Belous <pbelous@marvell.com>
Signed-off-by: default avatarDmitry Bogdanov <dbogdanov@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0ededb6e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment