linux/Documentation/networking
Stanislav Fomichev 04efcee6ef net: hold instance lock during NETDEV_CHANGE
Cosmin reports an issue with ipv6_add_dev being called from
NETDEV_CHANGE notifier:

[ 3455.008776]  ? ipv6_add_dev+0x370/0x620
[ 3455.010097]  ipv6_find_idev+0x96/0xe0
[ 3455.010725]  addrconf_add_dev+0x1e/0xa0
[ 3455.011382]  addrconf_init_auto_addrs+0xb0/0x720
[ 3455.013537]  addrconf_notify+0x35f/0x8d0
[ 3455.014214]  notifier_call_chain+0x38/0xf0
[ 3455.014903]  netdev_state_change+0x65/0x90
[ 3455.015586]  linkwatch_do_dev+0x5a/0x70
[ 3455.016238]  rtnl_getlink+0x241/0x3e0
[ 3455.019046]  rtnetlink_rcv_msg+0x177/0x5e0

Similarly, linkwatch might get to ipv6_add_dev without ops lock:
[ 3456.656261]  ? ipv6_add_dev+0x370/0x620
[ 3456.660039]  ipv6_find_idev+0x96/0xe0
[ 3456.660445]  addrconf_add_dev+0x1e/0xa0
[ 3456.660861]  addrconf_init_auto_addrs+0xb0/0x720
[ 3456.661803]  addrconf_notify+0x35f/0x8d0
[ 3456.662236]  notifier_call_chain+0x38/0xf0
[ 3456.662676]  netdev_state_change+0x65/0x90
[ 3456.663112]  linkwatch_do_dev+0x5a/0x70
[ 3456.663529]  __linkwatch_run_queue+0xeb/0x200
[ 3456.663990]  linkwatch_event+0x21/0x30
[ 3456.664399]  process_one_work+0x211/0x610
[ 3456.664828]  worker_thread+0x1cc/0x380
[ 3456.665691]  kthread+0xf4/0x210

Reclassify NETDEV_CHANGE as a notifier that consistently runs under the
instance lock.

Link: https://lore.kernel.org/netdev/aac073de8beec3e531c86c101b274d434741c28e.camel@nvidia.com/
Reported-by: Cosmin Ratiu <cratiu@nvidia.com>
Tested-by: Cosmin Ratiu <cratiu@nvidia.com>
Fixes: ad7c7b2172 ("net: hold netdev instance lock during sysfs operations")
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20250404161122.3907628-1-sdf@fomichev.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-04-07 11:13:39 -07:00
..
caif
device_drivers powerpc updates for 6.15 2025-03-27 19:39:08 -07:00
devlink bnxt_en: Add devlink support for ENABLE_ROCE nvm parameter 2025-03-18 10:25:22 +01:00
diagnostic
dsa
mac80211_hwsim
net_cachelines tcp/dccp: remove icsk->icsk_ack.timeout 2025-03-25 10:34:33 -07:00
netlink_spec
pse-pd
6lowpan.rst
6pack.rst
af_xdp.rst
alias.rst
arcnet-hardware.rst
arcnet.rst
atm.rst
ax25.rst
bareudp.rst
batman-adv.rst batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
bonding.rst
bridge.rst
can.rst
can_ucan_protocol.rst
cdc_mbim.rst
checksum-offloads.rst
dccp.rst
dctcp.rst
devmem.rst docs: fix the path of example code and example commands for device memory TCP 2025-03-24 12:12:09 -07:00
dns_resolver.rst
driver.rst
eql.rst
ethtool-netlink.rst ethtool: Symmetric OR-XOR RSS hash 2025-02-25 18:31:04 -08:00
failover.rst
fib_trie.rst
filter.rst
gen_stats.rst
generic-hdlc.rst
generic_netlink.rst
gtp.rst
ieee802154.rst
ila.rst
index.rst
ioam6-sysctl.rst
iou-zcrx.rst
ip-sysctl.rst tcp: support TCP_RTO_MIN_US for set/getsockopt use 2025-03-25 04:27:19 -07:00
ip_dynaddr.rst
ipsec.rst
ipv6.rst
ipvlan.rst
ipvs-sysctl.rst
iso15765-2.rst
j1939.rst
kapi.rst
kcm.rst docs/kcm: Fix typo "BFP" 2025-03-24 12:20:42 -07:00
l2tp.rst
lapb-module.rst
mac80211-auth-assoc-deauth.txt
mac80211-injection.rst
mctp.rst
mpls-sysctl.rst
mptcp-sysctl.rst mptcp: sysctl: add available_path_managers 2025-03-20 10:14:49 +01:00
mptcp.rst
msg_zerocopy.rst
multi-pf-netdev.rst
multiqueue.rst
napi.rst
net_dim.rst
net_failover.rst
netconsole.rst docs: netconsole: document release feature 2025-03-21 18:59:25 +01:00
netdev-features.rst
netdevices.rst net: hold instance lock during NETDEV_CHANGE 2025-04-07 11:13:39 -07:00
netfilter-sysctl.rst
netif-msg.rst
netmem.rst
nexthop-group-resilient.rst
nf_conntrack-sysctl.rst
nf_flowtable.rst
nfc.rst
oa-tc6-framework.rst
openvswitch.rst
operstates.rst
packet_mmap.rst
page_pool.rst
phonet.rst
phy-link-topology.rst
phy.rst
pktgen.rst
plip.rst
ppp_generic.rst
proc_net_tcp.rst
radiotap-headers.rst
rds.rst
regulatory.rst
representors.rst
rxrpc.rst
scaling.rst net: move aRFS rmap management and CPU affinity to core 2025-02-26 19:51:37 -08:00
sctp.rst
secid.rst
seg6-sysctl.rst
segmentation-offloads.rst
sfp-phylink.rst
skbuff.rst
smc-sysctl.rst
snmp_counter.rst
sriov.rst
statistics.rst
strparser.rst docs: networking: strparser: Fix a typo 2025-03-24 12:14:16 -07:00
switchdev.rst net: rename netns_local to netns_immutable 2025-03-04 12:44:48 +01:00
sysfs-tagging.rst
tc-actions-env-rules.rst
tc-queue-filters.rst
tcp-thin.rst
tcp_ao.rst
team.rst
timestamping.rst net-timestamp: COMPLETION timestamp on packet tx completion 2025-03-25 12:48:05 -04:00
tipc.rst
tls-handshake.rst
tls-offload-layers.svg
tls-offload-reorder-bad.svg
tls-offload-reorder-good.svg
tls-offload.rst
tls.rst
tproxy.rst
tuntap.rst
udplite.rst
vrf.rst
vxlan.rst
x25-iface.rst
x25.rst
xdp-rx-metadata.rst
xfrm_device.rst xfrm: provide common xdo_dev_offload_ok callback implementation 2025-02-21 08:08:15 +01:00
xfrm_proc.rst
xfrm_sync.rst
xfrm_sysctl.rst
xsk-tx-metadata.rst xsk: Add launch time hardware offload support to XDP Tx metadata 2025-02-20 15:13:45 -08:00