login: witness: lock order reversal: 1st 0xffffffff8290fe50 netlock (netlock) 2nd 0xfffffd806740ad20 vmmaplk (&map->lock) lock order "&map->lock"(rwlock) -> "netlock"(rwlock) first seen at: #0 rw_enter_write+0x5b sys/kern/kern_rwlock.c:128 #1 udp_sysctl+0x8a sys/netinet/udp_usrreq.c:1269 #2 sys_sysctl+0x209 sys/kern/kern_sysctl.c:249 #3 syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] #3 syscall+0x489 sys/arch/amd64/amd64/trap.c:585 #4 Xsyscall+0x128 lock order "netlock"(rwlock) -> "&map->lock"(rwlock) first seen at: #0 rw_enter_read+0x66 sys/kern/kern_rwlock.c:112 #1 uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1758 #2 uvm_fault_check+0x3a sys/uvm/uvm_fault.c:674 #3 uvm_fault+0x102 sys/uvm/uvm_fault.c:602 #4 kpageflttrap+0x209 #5 kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 #6 alltraps_kern_meltdown+0x7b #7 copyout+0x53 #8 ifioctl_get+0x2dd #9 soo_ioctl+0x26c #10 sys_ioctl+0x4a2 #11 syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] #11 syscall+0x489 sys/arch/amd64/amd64/trap.c:585 #12 Xsyscall+0x128 Stopped at db_enter+0x18: addq $0x8,%rsp ddb{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic the kernel did not panic ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440 witness_checkorder(fffffd806740ad20,1,0) at witness_checkorder+0x10b7 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd806740ad20,1,0) at witness_checkorder+0x10b7 sys/kern/subr_witness.c:1105 rw_enter_read(fffffd806740ad10) at rw_enter_read+0x66 sys/kern/kern_rwlock.c:112 uvmfault_lookup(ffff80002e3ca3d0,0) at uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1758 uvm_fault_check(ffff80002e3ca3d0,ffff80002e3ca408,ffff80002e3ca430) at uvm_fault_check+0x3a sys/uvm/uvm_fault.c:674 uvm_fault(fffffd806740ad08,20000000,0,2) at uvm_fault+0x102 sys/uvm/uvm_fault.c:602 kpageflttrap(ffff80002e3ca560,20000300) at kpageflttrap+0x209 kerntrap(ffff80002e3ca560) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 ifioctl_get(c0106924,ffff80002e3ca810) at ifioctl_get+0x2dd soo_ioctl(fffffd805ddfe570,c0106924,ffff80002e3ca810,ffff8000fffedcf0) at soo_ioctl+0x26c sys_ioctl(ffff8000fffedcf0,ffff80002e3ca928,ffff80002e3ca980) at sys_ioctl+0x4a2 syscall(ffff80002e3ca9f0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002e3ca9f0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf8b7880750, count: -15 ddb{0}> show registers rdi 0x3 rsi 0xffffffff8294abb0 __sancov_gen_cov_switch_values.134 rbp 0xffff80002e3ca0c0 rbx 0x3 rdx 0 rcx 0 rax 0xffff8000fffedcf0 r8 0xffff80002e3ca030 r9 0x8080808080808080 r10 0xc8760fe98cae87b6 r11 0x41835b7b2566b353 r12 0xffffffff82ab0900 w_lodata+0x52f90 r13 0 r14 0xffffffff82aa4300 w_lodata+0x46990 r15 0xfffffd8002f62d80 rip 0xffffffff8138d658 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002e3ca0b0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.3) pid=126450 stat=onproc flags process=10 proc=4000000 pri=78, usrpri=78, nice=20 forw=0xffffffffffffffff, list=0xffff8000fffed270,0xffff800021156800 process=0xffff8000fffe9910 user=0xffff80002e3c5000, vmspace=0xfffffd806740ad08 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 42052 364797 24456 32767 2 0x10 syz-executor.0 42052 498224 24456 32767 2 0x4000010 syz-executor.0 42052 32976 24456 32767 2 0x4000010 syz-executor.0 42052 24387 24456 32767 3 0x4000090 fsleep syz-executor.0 29688 46120 72083 32767 2 0x10 syz-executor.1 29688 182031 72083 32767 3 0x4000090 fsleep syz-executor.1 80378 248106 93220 32767 2 0x10 syz-executor.5 80378 199398 93220 32767 2 0x4000010 syz-executor.5 83595 32385 4605 32767 2 0x10 syz-executor.7 32528 384563 60840 32767 2 0x10 syz-executor.6 32528 159609 60840 32767 2 0x4000010 syz-executor.6 32528 326577 60840 32767 3 0x4000090 fsleep syz-executor.6 32528 285359 60840 32767 2 0x4000010 syz-executor.6 24129 50598 85105 32767 2 0x10 syz-executor.2 24129 319743 85105 32767 2 0x4000010 syz-executor.2 70558 182176 69572 32767 7 0x10 syz-executor.4 69664 107827 12634 32767 3 0x90 nanoslp syz-executor.3 69664 13363 12634 32767 3 0x4000090 fsleep syz-executor.3 69664 272442 12634 32767 2 0x4000010 syz-executor.3 *69664 126450 12634 32767 7 0x4000010 syz-executor.3 69664 322053 12634 32767 2 0x4000010 syz-executor.3 69664 100700 12634 32767 2 0x4000010 syz-executor.3 69664 161894 12634 32767 2 0x4000010 syz-executor.3 69664 415815 12634 32767 2 0x4000010 syz-executor.3 85105 431050 54007 32767 3 0x90 nanoslp syz-executor.2 54007 182747 54245 0 3 0x82 wait syz-executor.2 38109 271277 0 0 3 0x14200 bored sosplice 4605 281836 23619 32767 3 0x90 nanoslp syz-executor.7 69572 315189 41119 32767 3 0x90 nanoslp syz-executor.4 23619 398929 54245 0 3 0x82 wait syz-executor.7 60840 98656 80132 32767 3 0x90 nanoslp syz-executor.6 80132 410718 54245 0 3 0x82 wait syz-executor.6 12634 54680 55798 32767 3 0x90 nanoslp syz-executor.3 93220 47016 47605 32767 3 0x90 nanoslp syz-executor.5 55798 339989 54245 0 3 0x82 wait syz-executor.3 47605 91687 54245 0 3 0x82 wait syz-executor.5 41119 383022 54245 0 3 0x82 wait syz-executor.4 72083 454446 91057 32767 3 0x90 nanoslp syz-executor.1 91057 246056 54245 0 3 0x82 wait syz-executor.1 24456 351770 19962 32767 3 0x90 nanoslp syz-executor.0 19962 472922 54245 0 3 0x82 wait syz-executor.0 54245 470352 47437 0 3 0x82 thrsleep syz-fuzzer 54245 199146 47437 0 3 0x4000082 thrsleep syz-fuzzer 54245 43940 47437 0 3 0x4000082 thrsleep syz-fuzzer 54245 7209 47437 0 3 0x4000082 thrsleep syz-fuzzer 54245 473677 47437 0 3 0x4000082 thrsleep syz-fuzzer 54245 107880 47437 0 3 0x4000082 kqread syz-fuzzer 54245 411578 47437 0 3 0x4000082 thrsleep syz-fuzzer 54245 497880 47437 0 3 0x4000082 thrsleep syz-fuzzer 54245 509507 47437 0 3 0x4000082 thrsleep syz-fuzzer 47437 521463 75190 0 3 0x10008a sigsusp ksh 75190 306196 78620 0 3 0x9a kqread sshd 14548 436670 1 0 3 0x100083 ttyin getty 78620 120118 1 0 3 0x88 kqread sshd 43944 174311 3426 73 3 0x1100090 kqread syslogd 3426 423663 1 0 3 0x100082 netio syslogd 83434 66279 1 0 3 0x100080 kqread resolvd 71498 92448 76969 77 3 0x100092 kqread dhcpleased 9606 258864 76969 77 3 0x100092 kqread dhcpleased 76969 141946 1 0 3 0x80 kqread dhcpleased 13783 71237 0 0 3 0x14200 bored smr 22194 371846 0 0 2 0x14200 zerothread 3380 89345 0 0 3 0x14200 aiodoned aiodoned 44619 225193 0 0 3 0x14200 syncer update 50602 521720 0 0 3 0x14200 cleaner cleaner 13000 9891 0 0 3 0x14200 reaper reaper 54684 87871 0 0 3 0x14200 pgdaemon pagedaemon 73553 103611 0 0 3 0x14200 bored viomb 21144 62843 0 0 3 0x40014200 acpi0 acpi0 47729 444421 0 0 3 0x40014200 idle1 36209 213595 0 0 3 0x14200 bored softnet 83701 438389 0 0 3 0x14200 bored systqmp 33637 374694 0 0 3 0x14200 bored systq 57137 284648 0 0 3 0x40014200 bored softclock 75087 100496 0 0 3 0x40014200 idle0 1 447548 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 69664 (syz-executor.3) thread 0xffff8000fffedcf0 (126450) shared rwlock netlock r = 0 (0xffffffff8290fe50) #0 witness_lock+0x44d #1 ifioctl_get+0x2d5 sys/net/if.c:2319 #2 soo_ioctl+0x26c #3 sys_ioctl+0x4a2 #4 syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] #4 syscall+0x489 sys/arch/amd64/amd64/trap.c:585 #5 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff829de988) #0 witness_lock+0x44d #1 soo_ioctl+0x25a sys/kern/sys_socket.c:136 #2 sys_ioctl+0x4a2 #3 syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] #3 syscall+0x489 sys/arch/amd64/amd64/trap.c:585 #4 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10189 6409K 6419K 78643K 11289 0 pcb 13 8K 8K 78643K 13 0 rtable 246 7K 7K 78643K 481 0 ifaddr 81 16K 16K 78643K 103 0 counters 56 35K 35K 78643K 62 0 ioctlops 0 0K 2K 78643K 427 0 iov 0 0K 16K 78643K 401 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1270 79K 79K 78643K 2037 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 33 0 VM map 2 1K 1K 78643K 2 0 sem 12 1K 1K 78643K 43 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 26 97K 121K 78643K 3307 0 sigio 0 0K 0K 78643K 13 0 proc 56 74K 123K 78643K 733 0 subproc 104 6K 6K 78643K 143 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 103 0 in_multi 99 6K 7K 78643K 171 0 ether_multi 1 0K 0K 78643K 15 0 mrt 3 0K 0K 78643K 3 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 151 678K 678K 78643K 151 0 exec 0 0K 2K 78643K 941 0 tdb 3 0K 0K 78643K 3 0 pagedep 1 8K 8K 78643K 1 0 inodedep 1 32K 32K 78643K 1 0 newblk 1 0K 0K 78643K 1 0 VM swap 7 26K 26K 78643K 7 0 UVM amap 354 87K 88K 78643K 42875 0 UVM aobj 131 4K 4K 78643K 137 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 61 0 NDP 11 0K 2K 78643K 36 0 temp 125 4707K 4787K 78643K 11702 0 kqueue 12 18K 24K 78643K 266 0 SYN cache 2 16K 16K 78643K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 22 0 0 1 0 1 1 0 8 0 rtpcb 120 312 0 309 6 5 1 3 0 8 0 rtentry 112 149 0 35 4 0 4 4 0 8 0 unpcb 136 2589 0 2576 25 20 5 6 0 8 4 syncache 296 23 0 23 6 6 0 1 0 8 0 tcpqe 32 6 0 6 4 4 0 1 0 8 0 tcpcb 736 930 0 924 24 17 7 10 0 8 5 arp 120 24 0 6 1 0 1 1 0 8 0 ipq 40 12 0 12 2 2 0 1 0 8 0 ipqe 40 187 0 187 2 2 0 1 0 8 0 inpcb 304 1928 0 1878 27 20 7 7 0 8 3 ip6q 72 7 0 7 2 2 0 1 0 8 0 ip6af 40 14 0 14 2 2 0 1 0 8 0 nd6 48 38 0 10 1 0 1 1 0 8 0 kcovpl 48 11 0 3 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 598 0 134 29 0 29 29 0 8 0 art_table 32 599 0 134 4 0 4 4 0 8 0 art_node 16 148 0 44 1 0 1 1 0 8 0 sysvmsgpl 40 48 0 8 1 0 1 1 0 8 0 semapl 112 41 0 31 1 0 1 1 0 8 0 shmpl 112 134 0 6 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 6534 0 5101 90 0 90 90 0 8 0 ffsino 272 6534 0 5101 96 0 96 96 0 8 0 nchpl 144 11903 0 10277 63 0 63 63 0 8 0 uvmvnodes 80 5926 0 0 121 0 121 121 0 8 0 vnodes 224 5926 0 0 349 0 349 349 0 8 0 namei 1024 40028 0 40028 3 2 1 2 0 8 1 percpumem 16 43 0 3 1 0 1 1 0 8 0 scxspl 216 31510 0 31510 13 12 1 8 0 8 1 plimitpl 152 510 0 488 2 1 1 2 0 8 0 sigapl 424 3588 0 3536 7 1 6 7 0 8 0 futexpl 64 28911 0 28907 1 0 1 1 0 8 0 knotepl 120 346 0 0 10 0 10 10 0 8 0 kqueuepl 216 1640 0 1631 21 20 1 5 0 8 0 pipepl 336 593 0 565 12 9 3 8 0 8 0 fdescpl 496 3573 0 3536 7 2 5 6 0 8 0 filepl 152 24025 0 23702 40 23 17 17 0 8 4 lockfpl 104 1285 0 1283 1 0 1 1 0 8 0 lockfspl 48 490 0 488 1 0 1 1 0 8 0 sessionpl 144 26 0 10 1 0 1 1 0 8 0 pgrppl 48 231 0 215 1 0 1 1 0 8 0 ucredpl 96 4552 0 4534 1 0 1 1 0 8 0 zombiepl 144 3536 0 3536 1 0 1 1 0 8 1 processpl 1064 3588 0 3536 5 1 4 4 0 8 0 procpl 672 9084 0 9008 9 2 7 7 0 8 0 sosppl 168 18 0 18 2 2 0 1 0 8 0 sockpl 480 4848 0 4782 99 86 13 29 0 8 4 mcl64k 65536 16 0 0 2 0 2 2 0 8 0 mcl16k 16384 13 0 0 2 0 2 2 0 8 0 mcl12k 12288 13 0 0 2 0 2 2 0 8 0 mcl9k 9216 13 0 0 1 0 1 1 0 8 0 mcl8k 8192 17 0 0 3 0 3 3 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 188 0 0 22 1 21 22 0 8 0 mtagpl 96 4 0 0 1 0 1 1 0 8 0 mbufpl 256 456 0 0 24 0 24 24 0 8 0 bufpl 288 8827 0 2492 453 0 453 453 0 8 0 anonpl 24 940314 0 926031 120 26 94 106 0 186 0 amapchunkpl 152 101920 0 101082 41 6 35 37 0 158 0 amappl16 200 8462 0 8110 50 31 19 31 0 8 0 amappl15 192 519 0 512 1 0 1 1 0 8 0 amappl14 184 385 0 380 1 0 1 1 0 8 0 amappl13 176 1272 0 1264 1 0 1 1 0 8 0 amappl12 168 691 0 686 1 0 1 1 0 8 0 amappl11 160 560 0 547 1 0 1 1 0 8 0 amappl10 152 39 0 35 1 0 1 1 0 8 0 amappl9 144 469 0 465 1 0 1 1 0 8 0 amappl8 136 698 0 622 3 0 3 3 0 8 0 amappl7 128 128 0 116 1 0 1 1 0 8 0 amappl6 120 204 0 183 2 1 1 2 0 8 0 amappl5 112 3214 0 3191 1 0 1 1 0 8 0 amappl4 104 1453 0 1425 2 1 1 2 0 8 0 amappl3 96 1042 0 1025 1 0 1 1 0 8 0 amappl2 88 2183 0 2130 3 1 2 3 0 8 0 amappl1 80 65393 0 64746 20 5 15 18 0 8 0 amappl 88 42307 0 42036 7 0 7 7 0 92 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 72 136 0 6 3 0 3 3 0 8 0 uaddrrnd 24 3573 0 3536 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 3573 0 3536 1 0 1 1 0 8 0 vmmpekpl 168 28702 0 28662 3 0 3 3 0 8 0 vmmpepl 168 323206 0 320460 156 33 123 131 0 357 3 vmsppl 368 3572 0 3536 4 0 4 4 0 8 0 rwobjpl 56 82715 0 75339 105 0 105 105 0 8 0 pdppl 4096 7153 0 7072 165 84 81 93 0 8 0 pvpl 32 1650182 0 1630486 277 111 166 259 0 265 0 pmappl 248 3572 0 3536 4 1 3 3 0 8 0 extentpl 40 58 0 38 1 0 1 1 0 8 0 phpool 112 939 0 115 24 0 24 24 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440 witness_checkorder(fffffd806740ad20,1,0) at witness_checkorder+0x10b7 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd806740ad20,1,0) at witness_checkorder+0x10b7 sys/kern/subr_witness.c:1105 rw_enter_read(fffffd806740ad10) at rw_enter_read+0x66 sys/kern/kern_rwlock.c:112 uvmfault_lookup(ffff80002e3ca3d0,0) at uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1758 uvm_fault_check(ffff80002e3ca3d0,ffff80002e3ca408,ffff80002e3ca430) at uvm_fault_check+0x3a sys/uvm/uvm_fault.c:674 uvm_fault(fffffd806740ad08,20000000,0,2) at uvm_fault+0x102 sys/uvm/uvm_fault.c:602 kpageflttrap(ffff80002e3ca560,20000300) at kpageflttrap+0x209 kerntrap(ffff80002e3ca560) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 ifioctl_get(c0106924,ffff80002e3ca810) at ifioctl_get+0x2dd soo_ioctl(fffffd805ddfe570,c0106924,ffff80002e3ca810,ffff8000fffedcf0) at soo_ioctl+0x26c sys_ioctl(ffff8000fffedcf0,ffff80002e3ca928,ffff80002e3ca980) at sys_ioctl+0x4a2 syscall(ffff80002e3ca9f0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002e3ca9f0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf8b7880750, count: -15 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{1}> trace x86_ipi_db(ffff800020ce8ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __mp_lock(ffffffff829de780) at __mp_lock+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff829de780) at __mp_lock+0x129 sys/kern/kern_lock.c:147 syscall(ffff80002c956960) at syscall+0x3ef mi_syscall sys/sys/syscall_mi.h:93 [inline] syscall(ffff80002c956960) at syscall+0x3ef sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffbcd90, count: -6