Bug 271366 - Invoking IPv6 network device address event may sleep with the following non-sleepable locks held
Summary: Invoking IPv6 network device address event may sleep with the following non-s...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-11 18:06 UTC by Piotr Kubaj
Modified: 2023-08-27 15:43 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer freebsd_triage 2023-05-11 18:06:50 UTC
During booting of a CURRENT VM (rev. 74192f9b2d24) on powerpc64le, when starting vtnet0 NIC, there are following lock warnings:
Invoking IPv6 network device address event may sleep with the following non-sleepable locks held:
exclusive sleep mutex vtnet0-rx0 (vtnet0-rx0) r = 0 (0xc0000000081c0480) locked @ /usr/src/sys/dev/virtio/network/if_vtnet.c:2188
stack backtrace:
#0 0xc00000000091bb38 at witness_debugger+0x98
#1 0xc00000000091d300 at witness_warn+0x4b0
#2 0xc000000000b3ad38 at in6_update_ifa+0xc08
#3 0xc000000000b717b8 at in6_ifadd+0x268
#4 0xc000000000b6ce94 at nd6_ra_input+0x10e4
#5 0xc000000000b34bb8 at icmp6_input+0x8a8
#6 0xc000000000b53dfc at ip6_input+0xdac
#7 0xc000000000a432ac at netisr_dispatch_src+0x11c
#8 0xc000000000a43754 at netisr_dispatch+0x24
#9 0xc000000000a1b8c4 at ether_demux+0x1c4
#10 0xc000000000a1d6b4 at ether_nh_input+0x454
#11 0xc000000000a432ac at netisr_dispatch_src+0x11c
#12 0xc000000000a43754 at netisr_dispatch+0x24
#13 0xc000000000a1bec8 at ether_input+0x118
#14 0xc000000000a14a48 at if_input+0x28
#15 0xc0000000006c011c at vtnet_rxq_eof+0x83c
#16 0xc0000000006bf7f4 at vtnet_rx_vq_process+0xf4
#17 0xc0000000006b3cfc at virtqueue_intr+0x2c
lock order reversal: (sleepable after non-sleepable)
 1st 0xc0000000081c0480 vtnet0-rx0 (vtnet0-rx0, sleep mutex) @ /usr/src/sys/dev/virtio/network/if_vtnet.c:2188
 2nd 0xc0000000019f48c0 in6_multi_sx (in6_multi_sx, sx) @ /usr/src/sys/netinet6/in6_mcast.c:1219
lock order vtnet0-rx0 -> in6_multi_sx attempted at:
#0 0xc00000000091b570 at witness_checkorder+0xc60
#1 0xc00000000088e000 at _sx_xlock+0x90
#2 0xc000000000b46e64 at in6_joingroup+0x64
#3 0xc000000000b3b0e0 at in6_update_ifa+0xfb0
#4 0xc000000000b717b8 at in6_ifadd+0x268
#5 0xc000000000b6ce94 at nd6_ra_input+0x10e4
#6 0xc000000000b34bb8 at icmp6_input+0x8a8
#7 0xc000000000b53dfc at ip6_input+0xdac
#8 0xc000000000a432ac at netisr_dispatch_src+0x11c
#9 0xc000000000a43754 at netisr_dispatch+0x24
#10 0xc000000000a1b8c4 at ether_demux+0x1c4
#11 0xc000000000a1d6b4 at ether_nh_input+0x454
#12 0xc000000000a432ac at netisr_dispatch_src+0x11c
#13 0xc000000000a43754 at netisr_dispatch+0x24
#14 0xc000000000a1bec8 at ether_input+0x118
#15 0xc000000000a14a48 at if_input+0x28
#16 0xc0000000006c011c at vtnet_rxq_eof+0x83c
#17 0xc0000000006bf7f4 at vtnet_rx_vq_process+0xf4

I have in /etc/rc.conf:
ifconfig_vtnet0="DHCP"
ifconfig_vtnet0_ipv6="inet6 accept_rtadv"
Comment 1 Mina Galić freebsd_triage 2023-05-12 10:15:17 UTC
seen before, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269821 but i foolishly closed it, because i didn't realise it could be spurious
Comment 2 Christian Kujau 2023-08-27 15:43:30 UTC
Same here on amd64, running as a Xen DomU virtual machine:

$ uname -rv
15.0-CURRENT FreeBSD 15.0-CURRENT amd64 1500000 #0 main-n265049-8ed0ecf8024d: Sat Aug 26 14:44:23 UTC 2023     dummy@freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC

$ grep if /etc/rc.conf
ifconfig_DEFAULT="DHCP inet6 accept_rtadv"

$ dmesg
[...]
lo0: link state changed to UP
xn0: 2 link states coalesced
xn0: link state changed to UP
Invoking IPv6 network device address event may sleep with the following non-sleepable locks held:
exclusive sleep mutex xnrx_2 (netfront receive lock) r = 0 (0xfffffe006a304a78) locked @ /usr/src/sys/dev/xen/netfront/netfront.c:677
stack backtrace:
#0 0xffffffff80bcd5c5 at witness_debugger+0x65
#1 0xffffffff80bce75a at witness_warn+0x3fa
#2 0xffffffff80d7b39c at in6_update_ifa+0xc0c
#3 0xffffffff80da7109 at in6_ifadd+0x1d9
#4 0xffffffff80da3854 at nd6_ra_input+0x1034
#5 0xffffffff80d75c14 at icmp6_input+0x724
#6 0xffffffff80d8e5df at ip6_input+0xc9f
#7 0xffffffff80cb14cf at netisr_dispatch_src+0xaf
#8 0xffffffff80c93caa at ether_demux+0x17a
#9 0xffffffff80c95313 at ether_nh_input+0x393
#10 0xffffffff80cb14cf at netisr_dispatch_src+0xaf
#11 0xffffffff80c940e9 at ether_input+0xd9
#12 0xffffffff809cb78c at xn_rxeof+0x5ec
#13 0xffffffff809ccad8 at xn_intr+0x48
#14 0xffffffff80b126f9 at ithread_loop+0x279
#15 0xffffffff80b0eab2 at fork_exit+0x82
#16 0xffffffff8102fede at fork_trampoline+0xe
lock order reversal: (sleepable after non-sleepable)
 1st 0xfffffe006a304a78 xnrx_2 (netfront receive lock, sleep mutex) @ /usr/src/sys/dev/xen/netfront/netfront.c:677
 2nd 0xffffffff81aaaba0 in6_multi_sx (in6_multi_sx, sx) @ /usr/src/sys/netinet6/in6_mcast.c:1217
lock order netfront receive lock -> in6_multi_sx attempted at:
#0 0xffffffff80bcd18d at witness_checkorder+0xbfd
#1 0xffffffff80b645c2 at _sx_xlock+0x62
#2 0xffffffff80d83b61 at in6_joingroup+0x31
#3 0xffffffff80d7b765 at in6_update_ifa+0xfd5
#4 0xffffffff80da7109 at in6_ifadd+0x1d9
#5 0xffffffff80da3854 at nd6_ra_input+0x1034
#6 0xffffffff80d75c14 at icmp6_input+0x724
#7 0xffffffff80d8e5df at ip6_input+0xc9f
#8 0xffffffff80cb14cf at netisr_dispatch_src+0xaf
#9 0xffffffff80c93caa at ether_demux+0x17a
#10 0xffffffff80c95313 at ether_nh_input+0x393
#11 0xffffffff80cb14cf at netisr_dispatch_src+0xaf
#12 0xffffffff80c940e9 at ether_input+0xd9
#13 0xffffffff809cb78c at xn_rxeof+0x5ec
#14 0xffffffff809ccad8 at xn_intr+0x48
#15 0xffffffff80b126f9 at ithread_loop+0x279
#16 0xffffffff80b0eab2 at fork_exit+0x82
#17 0xffffffff8102fede at fork_trampoline+0xe