Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: netdev@vger.kernel.org, bridge@lists.linux.dev
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com, razor@blackwall.org, horms@kernel.org,
	sdf@fomichev.me, Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net 0/3] bridge: Fix sleep in atomic context
Date: Tue, 26 May 2026 09:48:15 +0300	[thread overview]
Message-ID: <20260526064818.272516-1-idosch@nvidia.com> (raw)

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


             reply	other threads:[~2026-05-26  6:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26  6:48 Ido Schimmel [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260526064818.272516-1-idosch@nvidia.com \
    --to=idosch@nvidia.com \
    --cc=bridge@lists.linux.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=sdf@fomichev.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox