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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Jul 2018 21:12:56 +0000 (14:12 -0700)
commitdea39aca1d7aef1e2b95b07edeacf04cc8863a2e
treedb097b90902be7acd610d3064edea3f10b67c826
parentb5d2d75e079a918be686957b1a8d2f6c5cc95a0a
net: lan78xx: Fix race in tx pending skb size calculation

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>
drivers/net/usb/lan78xx.c