]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit3a581d5af355959583068b38d62314ad2769066e
treedb097b90902be7acd610d3064edea3f10b67c826
parent645b63840bdfcbb7673e11e00df84cc5d0347c4e
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: f98af78833e9 ("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