Skip to content

bridge: Fix sleep in atomic context

Ido Schimmel bridge netdev 1 version Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bridge: Fix sleep in atomic context in netlink pathnet/bridge/br_netlink.c+7 -100 repliesApplied
2/3bridge: Fix sleep in atomic context in sysfs pathnet/bridge/br_switchdev.c net/bridge/br_sysfs_if.c+22 -90 repliesApplied
3/3selftests: rtnetlink: Add bridge promiscuity teststools/testing/selftests/net/rtnetlink.sh+63 -01 replyApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchNikolay Aleksandrov
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net 0/3] bridge: Fix sleep in atomic context

Under certain circumstances the bridge driver can call dev_set_promiscuity() while holding the bridge spin lock. This is a problem as dev_set_promiscuity() might sleep.

Patches #1-#2 fix the problem in the netlink and sysfs configuration paths by only taking the lock where it is actually needed, thereby avoiding calling dev_set_promiscuity() from an atomic context.

Patch #3 adds test cases for both configuration paths in rtnetlink.sh which already includes test cases for similar issues.

Note that dev_set_promiscuity() can sleep either when it takes the net device mutex or when calling netif_rx_mode_sync(). I encountered the problem with the latter, but blamed the former since it came earlier.

Ido Schimmel (3):
bridge: Fix sleep in atomic context in netlink path
bridge: Fix sleep in atomic context in sysfs path
selftests: rtnetlink: Add bridge promiscuity tests

 net/bridge/br_netlink.c                  | 17 +++----
 net/bridge/br_switchdev.c                |  1 -
 net/bridge/br_sysfs_if.c                 | 30 ++++++++---
 tools/testing/selftests/net/rtnetlink.sh | 63 ++++++++++++++++++++++++
 4 files changed, 92 insertions(+), 19 deletions(-)
Signature · 1 line
2.54.0