login: witness: lock order reversal: 1st 0xffffffff8290fe50 netlock (netlock) 2nd 0xfffffd806857a760 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{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic the kernel did not panic ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440 witness_checkorder(fffffd806857a760,1,0) at witness_checkorder+0x10b7 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd806857a760,1,0) at witness_checkorder+0x10b7 sys/kern/subr_witness.c:1105 rw_enter_read(fffffd806857a750) at rw_enter_read+0x66 sys/kern/kern_rwlock.c:112 uvmfault_lookup(ffff80002e37ac90,0) at uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1758 uvm_fault_check(ffff80002e37ac90,ffff80002e37acc8,ffff80002e37acf0) at uvm_fault_check+0x3a sys/uvm/uvm_fault.c:674 uvm_fault(fffffd806857a748,20000000,0,2) at uvm_fault+0x102 sys/uvm/uvm_fault.c:602 kpageflttrap(ffff80002e37ae20,20000300) at kpageflttrap+0x209 kerntrap(ffff80002e37ae20) 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,ffff80002e37b0d0) at ifioctl_get+0x2dd soo_ioctl(fffffd806993d3a8,c0106924,ffff80002e37b0d0,ffff800022c5bce8) at soo_ioctl+0x26c sys_ioctl(ffff800022c5bce8,ffff80002e37b1e8,ffff80002e37b240) at sys_ioctl+0x4a2 syscall(ffff80002e37b2b0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002e37b2b0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa8342792020, count: -15 ddb{1}> show registers rdi 0x3 rsi 0xffffffff8294abb0 __sancov_gen_cov_switch_values.134 rbp 0xffff80002e37a980 rbx 0x3 rdx 0 rcx 0 rax 0xffff800022c5bce8 r8 0xffff80002e37a8f0 r9 0x8080808080808080 r10 0x9758d4fe2f08bb81 r11 0x1ac567422d64cf9c r12 0xffffffff82ab07a0 w_lodata+0x52e30 r13 0 r14 0xffffffff82aa7270 w_lodata+0x49900 r15 0xfffffd8002f62d80 rip 0xffffffff8138d658 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002e37a970 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.3) pid=348867 stat=onproc flags process=10 proc=4000000 pri=81, usrpri=81, nice=20 forw=0xffffffffffffffff, list=0xffff8000212362a0,0xffff800026099a60 process=0xffff800029503a50 user=0xffff80002e376000, vmspace=0xfffffd806857a748 estcpu=31, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 44702 425852 70621 32767 2 0x10 syz-executor.7 44702 464654 70621 32767 3 0x4000090 fsleep syz-executor.7 18714 305580 41269 32767 2 0x10 syz-executor.1 18714 195510 41269 32767 3 0x4000090 fsleep syz-executor.1 18629 48073 95836 32767 3 0x90 nanoslp syz-executor.3 18629 130986 95836 32767 3 0x4000090 fsleep syz-executor.3 18629 419407 95836 32767 3 0x4000090 fsleep syz-executor.3 *18629 348867 95836 32767 7 0x4000010 syz-executor.3 18629 170065 95836 32767 2 0x4000010 syz-executor.3 68581 218376 4689 32767 2 0x10 syz-executor.2 68581 70817 4689 32767 2 0x4000010 syz-executor.2 66112 336520 32441 32767 2 0x10 syz-executor.0 66112 89288 32441 32767 2 0x4000010 syz-executor.0 66112 382129 32441 32767 3 0x4000090 fsleep syz-executor.0 66112 101533 32441 32767 2 0x4000010 syz-executor.0 41269 285359 34222 32767 3 0x90 nanoslp syz-executor.1 34222 361138 76003 0 3 0x82 wait syz-executor.1 46880 421450 13412 32767 3 0x90 nanoslp syz-executor.5 13412 186996 76003 0 3 0x82 wait syz-executor.5 63653 24761 0 0 3 0x14200 bored sosplice 70621 154560 87710 32767 2 0x10 syz-executor.7 87710 111530 76003 0 3 0x82 wait syz-executor.7 31933 271132 90232 32767 2 0x10 syz-executor.6 90232 372937 76003 0 3 0x82 wait syz-executor.6 70642 44673 92487 32767 2 0x10 syz-executor.4 95836 63934 33642 32767 3 0x90 nanoslp syz-executor.3 92487 285218 76003 0 3 0x82 wait syz-executor.4 33642 193710 76003 0 3 0x82 wait syz-executor.3 4689 158439 8143 32767 2 0x10 syz-executor.2 8143 342998 76003 0 3 0x82 wait syz-executor.2 32441 260849 80770 32767 3 0x90 nanoslp syz-executor.0 80770 87515 76003 0 3 0x82 wait syz-executor.0 76003 310669 3235 0 3 0x82 thrsleep syz-fuzzer 76003 249445 3235 0 3 0x4000082 nanoslp syz-fuzzer 76003 444000 3235 0 2 0x4000082 syz-fuzzer 76003 22643 3235 0 3 0x4000082 thrsleep syz-fuzzer 76003 142901 3235 0 3 0x4000082 thrsleep syz-fuzzer 76003 162286 3235 0 3 0x4000082 thrsleep syz-fuzzer 76003 420446 3235 0 3 0x4000082 nanoslp syz-fuzzer 76003 5138 3235 0 3 0x4000082 thrsleep syz-fuzzer 76003 28859 3235 0 3 0x4000082 thrsleep syz-fuzzer 3235 175950 34417 0 3 0x10008a sigsusp ksh 34417 60204 9483 0 3 0x9a kqread sshd 35317 150460 1 0 3 0x100083 ttyin getty 9483 370372 1 0 3 0x88 kqread sshd 3489 487286 72196 73 3 0x1100090 kqread syslogd 72196 357686 1 0 3 0x100082 netio syslogd 35502 452682 1 0 3 0x100080 kqread resolvd 3286 352347 4505 77 3 0x100092 kqread dhcpleased 61052 298352 4505 77 3 0x100092 kqread dhcpleased 4505 206383 1 0 3 0x80 kqread dhcpleased 79912 493680 0 0 3 0x14200 bored smr 78105 437825 0 0 2 0x14200 zerothread 12199 311250 0 0 3 0x14200 aiodoned aiodoned 17386 136760 0 0 3 0x14200 syncer update 59625 101588 0 0 3 0x14200 cleaner cleaner 62574 138840 0 0 7 0x14200 reaper 6157 66066 0 0 3 0x14200 pgdaemon pagedaemon 35048 21532 0 0 3 0x14200 bored viomb 58827 413689 0 0 3 0x40014200 acpi0 acpi0 25139 152780 0 0 3 0x40014200 idle1 83859 194857 0 0 2 0x14200 softnet 84718 18955 0 0 3 0x14200 bored systqmp 97353 127662 0 0 3 0x14200 bored systq 3180 382436 0 0 3 0x40014200 bored softclock 25146 160152 0 0 3 0x40014200 idle0 1 507432 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 18629 (syz-executor.3) thread 0xffff800022c5bce8 (348867) 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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10201 6411K 6419K 78643K 11305 0 pcb 13 8K 8K 78643K 13 0 rtable 244 7K 7K 78643K 629 0 ifaddr 81 16K 16K 78643K 110 0 counters 56 35K 35K 78643K 64 0 ioctlops 0 0K 2K 78643K 72 0 iov 0 0K 12K 78643K 84 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 5 0 vnodes 1270 79K 79K 78643K 1537 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 14 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 296 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 23 85K 113K 78643K 1084 0 sigio 0 0K 0K 78643K 24 0 proc 56 74K 99K 78643K 616 0 subproc 104 6K 6K 78643K 156 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 119 0 in_multi 99 6K 6K 78643K 160 0 ether_multi 1 0K 0K 78643K 4 0 mrt 1 0K 0K 78643K 2 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 223 996K 996K 78643K 223 0 exec 0 0K 2K 78643K 968 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 333 89K 98K 78643K 15014 0 UVM aobj 55 6K 6K 78643K 55 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 16 0 NDP 11 0K 2K 78643K 39 0 temp 125 4707K 4771K 78643K 6862 0 kqueue 12 18K 28K 78643K 96 0 SYN cache 2 16K 16K 78643K 2 0 ddb{1}> 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 144 0 141 3 2 1 3 0 8 0 rtentry 112 159 0 46 4 0 4 4 0 8 0 unpcb 136 1706 0 1693 9 4 5 6 0 8 4 syncache 296 13 0 13 3 2 1 1 0 8 1 tcpqe 32 327 0 327 3 2 1 1 0 8 1 tcpcb 736 537 0 529 13 4 9 12 0 8 8 arp 120 26 0 8 1 0 1 1 0 8 0 ipq 40 1 0 0 1 0 1 1 0 8 0 ipqe 40 3 0 2 1 0 1 1 0 8 0 inpcb 304 873 0 861 12 3 9 11 0 8 8 ip6q 72 2 0 2 1 1 0 1 0 8 0 ip6af 40 4 0 4 1 1 0 1 0 8 0 nd6 48 40 0 13 1 0 1 1 0 8 0 kcovpl 48 12 0 4 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 664 0 205 31 2 29 31 0 8 0 art_table 32 665 0 205 4 0 4 4 0 8 0 art_node 16 158 0 55 1 0 1 1 0 8 0 sysvmsgpl 40 6 0 6 1 1 0 1 0 8 0 semapl 112 294 0 284 1 0 1 1 0 8 0 shmpl 112 52 0 0 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2690 0 1261 90 0 90 90 0 8 0 ffsino 272 2690 0 1261 96 0 96 96 0 8 0 nchpl 144 4154 0 2526 62 0 62 62 0 8 0 uvmvnodes 80 2855 0 0 59 0 59 59 0 8 0 vnodes 224 2855 0 0 168 0 168 168 0 8 0 namei 1024 14300 0 14300 2 1 1 2 0 8 1 percpumem 16 44 0 4 1 0 1 1 0 8 0 scxspl 216 11736 0 11736 9 8 1 8 0 8 1 plimitpl 152 258 0 234 1 0 1 1 0 8 0 sigapl 424 1350 0 1300 7 1 6 7 0 8 0 futexpl 64 8120 0 8115 1 0 1 1 0 8 0 knotepl 120 355 0 0 11 0 11 11 0 8 0 kqueuepl 216 396 0 388 7 4 3 6 0 8 2 pipepl 336 356 0 327 14 11 3 11 0 8 0 fdescpl 496 1335 0 1301 7 2 5 6 0 8 0 filepl 152 9020 0 8778 26 9 17 17 0 8 7 lockfpl 104 93 0 91 1 0 1 1 0 8 0 lockfspl 48 44 0 42 1 0 1 1 0 8 0 sessionpl 144 27 0 11 1 0 1 1 0 8 0 pgrppl 48 27 0 11 1 0 1 1 0 8 0 ucredpl 96 1261 0 1243 1 0 1 1 0 8 0 zombiepl 144 1301 0 1300 1 0 1 1 0 8 0 processpl 1064 1350 0 1300 5 1 4 4 0 8 0 procpl 672 3207 0 3139 9 2 7 8 0 8 0 sosppl 168 18 0 18 2 1 1 1 0 8 1 sockpl 480 2731 0 2703 57 45 12 29 0 8 8 mcl64k 65536 12 0 0 2 0 2 2 0 8 0 mcl16k 16384 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 5 0 0 1 0 1 1 0 8 0 mcl8k 8192 9 0 0 2 0 2 2 0 8 0 mcl4k 4096 14 0 0 2 0 2 2 0 8 0 mcl2k2 2112 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 169 0 0 21 0 21 21 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 405 0 0 25 0 25 25 0 8 0 bufpl 288 4751 0 149 329 0 329 329 0 8 0 anonpl 24 331982 0 318420 108 9 99 99 0 186 9 amapchunkpl 152 36590 0 35812 48 10 38 42 0 158 5 amappl16 200 2340 0 2001 20 1 19 19 0 8 0 amappl15 192 132 0 125 1 0 1 1 0 8 0 amappl14 184 131 0 124 1 0 1 1 0 8 0 amappl13 176 104 0 102 1 0 1 1 0 8 0 amappl12 168 142 0 136 1 0 1 1 0 8 0 amappl11 160 55 0 45 1 0 1 1 0 8 0 amappl10 152 126 0 120 1 0 1 1 0 8 0 amappl9 144 726 0 716 1 0 1 1 0 8 0 amappl8 136 1027 0 961 3 0 3 3 0 8 0 amappl7 128 473 0 454 1 0 1 1 0 8 0 amappl6 120 453 0 429 2 1 1 2 0 8 0 amappl5 112 1218 0 1196 1 0 1 1 0 8 0 amappl4 104 892 0 865 2 1 1 2 0 8 0 amappl3 96 418 0 406 1 0 1 1 0 8 0 amappl2 88 599 0 556 3 1 2 3 0 8 0 amappl1 80 27323 0 26696 18 3 15 18 0 8 0 amappl 88 14500 0 14242 8 1 7 8 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 54 0 0 1 0 1 1 0 8 0 uaddrrnd 24 1335 0 1301 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1335 0 1301 1 0 1 1 0 8 0 vmmpekpl 168 15132 0 15088 3 0 3 3 0 8 0 vmmpepl 168 125261 0 122716 126 2 124 124 0 357 5 vmsppl 368 1334 0 1300 4 0 4 4 0 8 0 rwobjpl 56 33702 0 29508 64 3 61 61 0 8 0 pdppl 4096 2677 0 2600 132 51 81 89 0 8 4 pvpl 32 677076 0 658390 249 35 214 249 0 265 54 pmappl 248 1334 0 1300 4 1 3 3 0 8 0 extentpl 40 58 0 38 1 0 1 1 0 8 0 phpool 112 771 0 71 20 0 20 20 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{0}> trace x86_ipi_db(ffffffff829baff0) 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+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff829de780) at __mp_lock+0x122 sys/kern/kern_lock.c:147 intr_handler(ffff800021135140,ffff800000077500) at intr_handler+0x5e sys/arch/amd64/amd64/intr.c:532 Xintr_ioapic_edge16_untramp() at Xintr_ioapic_edge16_untramp+0x18f __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x28 kd_curproc sys/dev/kcov.c:577 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x28 sys/dev/kcov.c:148 __mp_lock(ffffffff829de780) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff829de780) at __mp_lock+0x133 sys/kern/kern_lock.c:147 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:88 Xsoftclock() at Xsoftclock+0x1f __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 uvm_unmap_detach(ffff800021135410,1) at uvm_unmap_detach+0x113 sys/uvm/uvm_map.c:1615 uvm_map_teardown(fffffd806857a8b8) at uvm_map_teardown+0x262 sys/uvm/uvm_map.c:2789 uvmspace_free(fffffd806857a8b8) at uvmspace_free+0xa6 sys/uvm/uvm_map.c:3685 reaper(ffff8000210f9a40) at reaper+0x18b sys/kern/kern_exit.c:457 end trace frame: 0x0, count: -15 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x18: addq $0x8,%rsp ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440 witness_checkorder(fffffd806857a760,1,0) at witness_checkorder+0x10b7 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd806857a760,1,0) at witness_checkorder+0x10b7 sys/kern/subr_witness.c:1105 rw_enter_read(fffffd806857a750) at rw_enter_read+0x66 sys/kern/kern_rwlock.c:112 uvmfault_lookup(ffff80002e37ac90,0) at uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1758 uvm_fault_check(ffff80002e37ac90,ffff80002e37acc8,ffff80002e37acf0) at uvm_fault_check+0x3a sys/uvm/uvm_fault.c:674 uvm_fault(fffffd806857a748,20000000,0,2) at uvm_fault+0x102 sys/uvm/uvm_fault.c:602 kpageflttrap(ffff80002e37ae20,20000300) at kpageflttrap+0x209 kerntrap(ffff80002e37ae20) 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,ffff80002e37b0d0) at ifioctl_get+0x2dd soo_ioctl(fffffd806993d3a8,c0106924,ffff80002e37b0d0,ffff800022c5bce8) at soo_ioctl+0x26c sys_ioctl(ffff800022c5bce8,ffff80002e37b1e8,ffff80002e37b240) at sys_ioctl+0x4a2 syscall(ffff80002e37b2b0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002e37b2b0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa8342792020, count: -15