net: avoid nested UP notifier events
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 10 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | net: turn the rx_mode work into a generic netdev_work facilityinclude/ net/ net/ +3 more | +138 | 3 replies | |
| 2/4 | net: add the driver-facing netdev_work scheduling APIinclude/ net/ | +74 | 2 replies | |
| 3/4 | vlan: defer real device state propagation to netdev_workDocumentation/ net/ net/ +2 more | +82 | 3 replies | |
| 4/4 | selftests: bonding: add a test for VLAN propagation over a bonded real devicetools/ tools/ | +181 | 2 replies |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Kuniyuki Iwashima | Aleksandr Loktionov | Nicolai Buchwitz | Stanislav Fomichev |
|---|---|---|---|---|
| 1/4 | R-b | A-b | ||
| 2/4 | R-b | A-b | ||
| 3/4 | R-b | R-b | A-b | |
| 4/4 | R-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH net 0/4] net: avoid nested UP notifier events
syzbot reported that recent ethtool rework leads to deadlock on stacked devices. VLANs create nested notifications, confusing execution context. Bringing up dummy causes vlan to bring itself up as well. Which in turn causes bond to ask for link state - a call chain traveling in the opposite direction.
bond (3) bond_update_speed_duplex(vlan)
| ^ v
vlan (2) UP(vlan) (4) vlan_ethtool_get_link_ksettings()
| ^ v
dummy (1) UP(dummy) (5) __ethtool_get_link_ksettings()
We locked the instance lock of dummy at (1) and will will try to lock it again at (5) - which of course deadlocks.
For non-nested notifications this is avoided because NETDEV_UP is always run ops-locked (so that bond asks for link using the netif_ API which assumes instance lock already held). The nesting, however, makes this problematic, we cannot carry the state of the whole chain back in the opposite direction.
AFAICT vlan is the only driver which causes such issues. So let's try a localized fix of deferring vlan auto-open to a workqueue.
Jakub Kicinski (4):
net: turn the rx_mode work into a generic netdev_work facility
net: add the driver-facing netdev_work scheduling API
vlan: defer real device state propagation to netdev_work
selftests: bonding: add a test for VLAN propagation over a bonded real
device
Documentation/networking/netdevices.rst | 2 + net/core/Makefile | 2 +- .../selftests/drivers/net/bonding/Makefile | 1 + include/linux/netdevice.h | 21 +- net/8021q/vlan.h | 11 ++ net/core/dev.h | 11 +- net/8021q/vlan.c | 76 +------- net/8021q/vlan_dev.c | 60 ++++++ net/core/dev.c | 2 + net/core/dev_addr_lists.c | 77 +------- net/core/netdev_work.c | 162 ++++++++++++++++ .../drivers/net/bonding/bond_vlan_real_dev.sh | 180 ++++++++++++++++++ 12 files changed, 457 insertions(+), 148 deletions(-) create mode 100644 net/core/netdev_work.c create mode 100755 tools/testing/selftests/drivers/net/bonding/bond_vlan_real_dev.sh
Signature · 1 line
2.54.0