aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-03-24 15:45:33 -0700
committerJakub Kicinski <kuba@kernel.org>2025-03-25 10:06:49 -0700
commitb52458652eca5a551ddb55605201b136f091b04d (patch)
treef3a934ee1001a31e62f38e7cef6c014efa7f6f56 /net/core/dev.c
parentnet: designate queue -> napi linking as "ops protected" (diff)
downloadwireguard-linux-b52458652eca5a551ddb55605201b136f091b04d.tar.xz
wireguard-linux-b52458652eca5a551ddb55605201b136f091b04d.zip
net: protect rxq->mp_params with the instance lock
Ensure that all accesses to mp_params are under the netdev instance lock. The only change we need is to move dev_memory_provider_uninstall() under the lock. Appropriately swap the asserts. Reviewed-by: Mina Almasry <almasrymina@google.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Link: https://patch.msgid.link/20250324224537.248800-8-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index ab74e1f005d2..b597cc27a115 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -10358,7 +10358,7 @@ u32 dev_get_min_mp_channel_count(const struct net_device *dev)
{
int i;
- ASSERT_RTNL();
+ netdev_ops_assert_locked(dev);
for (i = dev->real_num_rx_queues - 1; i >= 0; i--)
if (dev->_rx[i].mp_params.mp_priv)
@@ -11962,9 +11962,9 @@ void unregister_netdevice_many_notify(struct list_head *head,
dev_tcx_uninstall(dev);
netdev_lock_ops(dev);
dev_xdp_uninstall(dev);
+ dev_memory_provider_uninstall(dev);
netdev_unlock_ops(dev);
bpf_dev_bound_netdev_unregister(dev);
- dev_memory_provider_uninstall(dev);
netdev_offload_xstats_disable_all(dev);