net: lan78xx: Fix race in tx pending skb size calculation
authorStefan Wahren <stefan.wahren@i2se.com>
Sun, 15 Jul 2018 19:53:20 +0000 (21:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Jul 2018 12:28:48 +0000 (14:28 +0200)
commit2be27d444f61c5542df5c00892817124582428a4
tree94bb56db09654b36f3ca13b41fb88c58b80f668d
parent12c0949a07458103b539eaba2330763873ef4cb5
net: lan78xx: Fix race in tx pending skb size calculation

commit dea39aca1d7aef1e2b95b07edeacf04cc8863a2e upstream.

The skb size calculation in lan78xx_tx_bh is in race with the start_xmit,
which could lead to rare kernel oopses. So protect the whole skb walk with
a spin lock. As a benefit we can unlink the skb directly.

This patch was tested on Raspberry Pi 3B+

Link: https://github.com/raspberrypi/linux/issues/2608
Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/usb/lan78xx.c