Netdev List
 help / color / mirror / Atom feed
* [PATCH net 0/3] bridge: Fix sleep in atomic context
@ 2026-05-26  6:48 Ido Schimmel
  2026-05-26  6:48 ` [PATCH net 1/3] bridge: Fix sleep in atomic context in netlink path Ido Schimmel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ido Schimmel @ 2026-05-26  6:48 UTC (permalink / raw)
  To: netdev, bridge
  Cc: davem, kuba, pabeni, edumazet, razor, horms, sdf, Ido Schimmel

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(-)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-26  6:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26  6:48 [PATCH net 0/3] bridge: Fix sleep in atomic context Ido Schimmel
2026-05-26  6:48 ` [PATCH net 1/3] bridge: Fix sleep in atomic context in netlink path Ido Schimmel
2026-05-26  6:48 ` [PATCH net 2/3] bridge: Fix sleep in atomic context in sysfs path Ido Schimmel
2026-05-26  6:48 ` [PATCH net 3/3] selftests: rtnetlink: Add bridge promiscuity tests Ido Schimmel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox