diff options
author | 2025-05-16 16:22:05 -0700 | |
---|---|---|
committer | 2025-05-20 18:12:58 -0700 | |
commit | f792709e0baad67224180d73d51c2f090003adde (patch) | |
tree | 7a955d7a45080c7daa22357d4eb2142df9b410ce /net/core/dev.c | |
parent | eth: fbnic: Replace kzalloc/fbnic_fw_init_cmpl with fbnic_fw_alloc_cmpl (diff) | |
download | wireguard-linux-f792709e0baad67224180d73d51c2f090003adde.tar.xz wireguard-linux-f792709e0baad67224180d73d51c2f090003adde.zip |
selftests: net: validate team flags propagation
Cover three recent cases:
1. missing ops locking for the lowers during netdev_sync_lower_features
2. missing locking for dev_set_promiscuity (plus netdev_ops_assert_locked
with a comment on why/when it's needed)
3. rcu lock during team_change_rx_flags
Verified that each one triggers when the respective fix is reverted.
Not sure about the placement, but since it all relies on teaming,
added to the teaming directory.
One ugly bit is that I add NETIF_F_LRO to netdevsim; there is no way
to trigger netdev_sync_lower_features without it.
Signed-off-by: Stanislav Fomichev <stfomichev@gmail.com>
Link: https://patch.msgid.link/20250516232205.539266-1-stfomichev@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index fccf2167b235..6d1a238dd440 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9278,8 +9278,16 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc, bool notify) dev_change_rx_flags(dev, IFF_PROMISC); } - if (notify) + if (notify) { + /* The ops lock is only required to ensure consistent locking + * for `NETDEV_CHANGE` notifiers. This function is sometimes + * called without the lock, even for devices that are ops + * locked, such as in `dev_uc_sync_multiple` when using + * bonding or teaming. + */ + netdev_ops_assert_locked(dev); __dev_notify_flags(dev, old_flags, IFF_PROMISC, 0, NULL); + } return 0; } |