aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/utils.c
diff options
context:
space:
mode:
authorSaurabh Sengar <[email protected]>2025-05-29 10:18:30 +0000
committerJakub Kicinski <[email protected]>2025-05-31 02:31:25 +0000
commit3ec523304976648b45a3eef045e97d17122ff1b2 (patch)
tree6817b670518ebbfc8f0b90d14e70b4cef63952a4 /net/core/utils.c
parentnet: Fix net_devmem_bind_dmabuf for non-devmem configs (diff)
downloadkernel-3ec523304976648b45a3eef045e97d17122ff1b2.tar.gz
kernel-3ec523304976648b45a3eef045e97d17122ff1b2.zip
hv_netvsc: fix potential deadlock in netvsc_vf_setxdp()
The MANA driver's probe registers netdevice via the following call chain: mana_probe() register_netdev() register_netdevice() register_netdevice() calls notifier callback for netvsc driver, holding the netdev mutex via netdev_lock_ops(). Further this netvsc notifier callback end up attempting to acquire the same lock again in dev_xdp_propagate() leading to deadlock. netvsc_netdev_event() netvsc_vf_setxdp() dev_xdp_propagate() This deadlock was not observed so far because net_shaper_ops was never set, and thus the lock was effectively a no-op in this case. Fix this by using netif_xdp_propagate() instead of dev_xdp_propagate() to avoid recursive locking in this path. And, since no deadlock is observed on the other path which is via netvsc_probe, add the lock exclusivly for that path. Also, clean up the unregistration path by removing the unnecessary call to netvsc_vf_setxdp(), since unregister_netdevice_many_notify() already performs this cleanup via dev_xdp_uninstall(). Fixes: 97246d6d21c2 ("net: hold netdev instance lock during ndo_bpf") Cc: [email protected] Signed-off-by: Saurabh Sengar <[email protected]> Tested-by: Erni Sri Satya Vennela <[email protected]> Reviewed-by: Haiyang Zhang <[email protected]> Reviewed-by: Subbaraya Sundeep <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/utils.c')
0 files changed, 0 insertions, 0 deletions