Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: lan78xx: Fix race in tx skb size calculation #2614

Merged
merged 1 commit into from
Jul 11, 2018

Conversation

lategoodbye
Copy link
Contributor

@lategoodbye lategoodbye commented Jul 10, 2018

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

#2608

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

raspberrypi#2608

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet")
@JamesH65
Copy link
Contributor

@lategoodbye Good work. Are you going to send this to netdev for further discussion and upstreaming?

@lategoodbye
Copy link
Contributor Author

Yes, but this will happen next week.

@pelwell pelwell merged commit db81c14 into raspberrypi:rpi-4.14.y Jul 11, 2018
@pelwell
Copy link
Contributor

pelwell commented Jul 11, 2018

Thanks, gents.

popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Jul 11, 2018
See: raspberrypi/linux#2614

kernel: vc4: DPI support
See: raspberrypi/linux#2429

kernel: spi: Make GPIO CSs honour the SPI_NO_CS flag
See: raspberrypi/linux#2169

kernel: overlays: Add addr parameter to i2c-rtc (& -gpio)
See: raspberrypi/linux#2611

userland: mmal: Remove unused mmal_metadata header file
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jul 11, 2018
See: raspberrypi/linux#2614

kernel: vc4: DPI support
See: raspberrypi/linux#2429

kernel: spi: Make GPIO CSs honour the SPI_NO_CS flag
See: raspberrypi/linux#2169

kernel: overlays: Add addr parameter to i2c-rtc (& -gpio)
See: raspberrypi/linux#2611

userland: mmal: Remove unused mmal_metadata header file
@lategoodbye
Copy link
Contributor Author

Yesterday, i sent the patch to netdev.

@JamesH65
Copy link
Contributor

Following on from discussion in linked thread, I seem to be seeing odd behaviour with this patch, with the unplugging of the network cable not being detected. Which makes no sense. Investigating.

@JamesH65
Copy link
Contributor

Some minor logging changes indicate that the lan78xx_status function is never called in the failing case., which would indicate that the interrupt over USB (intr_urb) from the lan78xx is being lost somewhere. Looking at logging in the working case, I get that 'interrupt' every time the cable is removed. However, I cannot think of a sequence invvolving that queue walk that could result in this sort of behaviour.

@lategoodbye
Copy link
Contributor Author

I only want to inform you that this patch has been merged upstream and also go to stable.

@pelwell
Copy link
Contributor

pelwell commented Jul 18, 2018

Thanks, Stefan. If GitHub had a Super Contributor badge you would get one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants