login: witness: lock order reversal: 1st 0xffffffff8290fe50 netlock (netlock) 2nd 0xfffffd806a899ba8 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(fffffd806a899ba8,1,0) at witness_checkorder+0x10b7 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd806a899ba8,1,0) at witness_checkorder+0x10b7 sys/kern/subr_witness.c:1105 rw_enter_read(fffffd806a899b98) at rw_enter_read+0x66 sys/kern/kern_rwlock.c:112 uvmfault_lookup(ffff80002e3718b0,0) at uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1758 uvm_fault_check(ffff80002e3718b0,ffff80002e3718e8,ffff80002e371910) at uvm_fault_check+0x3a sys/uvm/uvm_fault.c:674 uvm_fault(fffffd806a899b90,20000000,0,2) at uvm_fault+0x102 sys/uvm/uvm_fault.c:602 kpageflttrap(ffff80002e371a40,20000300) at kpageflttrap+0x209 kerntrap(ffff80002e371a40) 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,ffff80002e371cf0) at ifioctl_get+0x2dd soo_ioctl(fffffd8068f7f1e8,c0106924,ffff80002e371cf0,ffff8000294fe540) at soo_ioctl+0x26c sys_ioctl(ffff8000294fe540,ffff80002e371e08,ffff80002e371e60) at sys_ioctl+0x4a2 syscall(ffff80002e371ed0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002e371ed0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x760db89d120, count: -15 ddb{0}> show registers rdi 0x3 rsi 0xffffffff8294abb0 __sancov_gen_cov_switch_values.134 rbp 0xffff80002e3715a0 rbx 0x3 rdx 0 rcx 0 rax 0xffff8000294fe540 r8 0xffff80002e371510 r9 0x8080808080808080 r10 0x964c3a73b32ed05c r11 0x2ca23f811274bb7b r12 0xffffffff82ab0380 w_lodata+0x52a10 r13 0 r14 0xffffffff82aa7480 w_lodata+0x49b10 r15 0xfffffd8002f62d80 rip 0xffffffff8138d658 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002e371590 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.7) pid=260477 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=79, nice=20 forw=0xffffffffffffffff, list=0xffff8000294ff260,0xffff80002465f278 process=0xffff8000294f4020 user=0xffff80002e36c000, vmspace=0xfffffd806a899b90 estcpu=29, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 79963 309927 31894 32767 2 0x10 syz-executor.6 45340 305460 61616 32767 2 0x10 syz-executor.4 57663 27640 28382 32767 2 0x10 syz-executor.5 22787 420393 84852 32767 2 0x10 syz-executor.2 22787 53948 84852 32767 2 0x4000010 syz-executor.2 89803 196960 27018 32767 2 0x10 syz-executor.3 89803 225677 27018 32767 3 0x4000090 ttyretype syz-executor.3 45933 147936 33739 32767 2 0x10 syz-executor.0 63276 188573 74651 32767 2 0x10 syz-executor.7 *63276 260477 74651 32767 7 0x4000010 syz-executor.7 31894 128938 59156 32767 3 0x90 nanoslp syz-executor.6 28382 69493 10201 32767 2 0x490 syz-executor.5 74651 226407 17084 32767 3 0x90 nanoslp syz-executor.7 59156 280065 62143 0 3 0x82 wait syz-executor.6 17084 54922 62143 0 3 0x82 wait syz-executor.7 10201 77191 62143 0 3 0x82 wait syz-executor.5 84852 339156 44840 32767 3 0x90 nanoslp syz-executor.2 61616 14053 136 32767 3 0x90 nanoslp syz-executor.4 136 53817 62143 0 3 0x82 wait syz-executor.4 27018 184607 68611 32767 3 0x90 nanoslp syz-executor.3 44840 226721 62143 0 3 0x82 wait syz-executor.2 68611 315697 62143 0 3 0x82 wait syz-executor.3 16976 496045 69277 32767 2 0x10 syz-executor.1 33739 29562 97444 32767 3 0x90 nanoslp syz-executor.0 69277 516697 62143 0 3 0x82 wait syz-executor.1 97444 133413 62143 0 3 0x82 wait syz-executor.0 62143 121549 7356 0 7 0x2 syz-fuzzer 62143 273008 7356 0 2 0x4000082 syz-fuzzer 62143 381737 7356 0 3 0x4000082 thrsleep syz-fuzzer 62143 28485 7356 0 3 0x4000082 thrsleep syz-fuzzer 62143 120773 7356 0 3 0x4000082 thrsleep syz-fuzzer 62143 350029 7356 0 2 0x4000082 syz-fuzzer 62143 230330 7356 0 3 0x4000082 thrsleep syz-fuzzer 62143 270254 7356 0 3 0x4000082 thrsleep syz-fuzzer 7356 411783 73164 0 3 0x10008a sigsusp ksh 73164 353310 16068 0 2 0x9a sshd 31162 23563 1 0 3 0x100083 ttyin getty 16068 265654 1 0 3 0x88 kqread sshd 65773 510547 60301 73 3 0x1100090 kqread syslogd 60301 10135 1 0 3 0x100082 netio syslogd 28420 166536 1 0 3 0x100080 kqread resolvd 20806 7121 19092 77 3 0x100092 kqread dhcpleased 35313 448053 19092 77 3 0x100092 kqread dhcpleased 19092 119752 1 0 3 0x80 kqread dhcpleased 28901 190183 0 0 3 0x14200 bored smr 75004 29483 0 0 2 0x14200 zerothread 14951 231513 0 0 3 0x14200 aiodoned aiodoned 57380 245397 0 0 3 0x14200 syncer update 60914 194272 0 0 3 0x14200 cleaner cleaner 4792 259483 0 0 3 0x14200 reaper reaper 49122 355530 0 0 3 0x14200 pgdaemon pagedaemon 9048 26238 0 0 3 0x14200 bored viomb 83318 105517 0 0 3 0x40014200 acpi0 acpi0 46295 30118 0 0 3 0x40014200 idle1 111 316496 0 0 3 0x14200 bored softnet 66447 283083 0 0 3 0x14200 bored systqmp 94430 355723 0 0 3 0x14200 bored systq 25324 494168 0 0 3 0x40014200 bored softclock 79885 62912 0 0 3 0x40014200 idle0 1 390750 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 63276 (syz-executor.7) thread 0xffff8000294fe540 (260477) 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 10169 6406K 6419K 78643K 11259 0 pcb 13 10K 12K 78643K 15 0 rtable 240 6K 7K 78643K 350 0 ifaddr 81 16K 16K 78643K 82 0 sysctl 2 0K 0K 78643K 2 0 counters 56 35K 35K 78643K 56 0 ioctlops 0 0K 2K 78643K 34 0 iov 0 0K 4K 78643K 9 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 5 0 vnodes 1270 79K 79K 78643K 1313 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 13K 78643K 82 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 1K 78643K 21 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 25 93K 129K 78643K 1327 0 sigio 0 0K 0K 78643K 18 0 proc 56 74K 111K 78643K 471 0 subproc 104 6K 6K 78643K 104 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 68 0 in_multi 99 6K 6K 78643K 99 0 ether_multi 1 0K 0K 78643K 1 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 37 175K 175K 78643K 37 0 exec 0 0K 2K 78643K 632 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 310 80K 95K 78643K 17038 0 UVM aobj 14 2K 2K 78643K 15 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 11 0K 2K 78643K 27 0 temp 125 4707K 4771K 78643K 6769 0 kqueue 12 18K 24K 78643K 63 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 36 0 33 1 0 1 1 0 8 0 rtentry 112 112 0 1 4 0 4 4 0 8 0 unpcb 136 218 0 205 1 0 1 1 0 8 0 syncache 296 6 0 6 3 2 1 1 0 8 1 tcpqe 32 26 0 26 1 1 0 1 0 8 0 tcpcb 736 336 0 313 18 9 9 18 0 8 6 arp 120 18 0 0 1 0 1 1 0 8 0 ipq 40 2 0 0 1 0 1 1 0 8 0 ipqe 40 100 0 98 1 0 1 1 0 8 0 inpcb 304 392 0 381 9 0 9 9 0 8 7 ip6q 72 1 0 0 1 0 1 1 0 8 0 ip6af 40 1 0 0 1 0 1 1 0 8 0 nd6 48 25 0 0 1 0 1 1 0 8 0 kcovpl 48 8 0 0 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 454 0 0 29 0 29 29 0 8 0 art_table 32 455 0 0 4 0 4 4 0 8 0 art_node 16 111 0 10 1 0 1 1 0 8 0 sysvmsgpl 40 6 0 4 1 0 1 1 0 8 0 semupl 112 2 0 2 1 0 1 1 0 8 1 semapl 112 19 0 9 1 0 1 1 0 8 0 shmpl 112 12 0 1 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2747 0 1318 90 0 90 90 0 8 0 ffsino 272 2747 0 1318 96 0 96 96 0 8 0 nchpl 144 4318 0 2654 62 0 62 62 0 8 0 uvmvnodes 80 2860 0 0 59 0 59 59 0 8 0 vnodes 224 2860 0 0 169 0 169 169 0 8 0 namei 1024 11562 0 11562 2 1 1 2 0 8 1 percpumem 16 40 0 0 1 0 1 1 0 8 0 scxspl 216 12955 0 12955 9 8 1 8 0 8 1 plimitpl 152 108 0 85 1 0 1 1 0 8 0 sigapl 424 1599 0 1549 7 1 6 7 0 8 0 futexpl 64 3633 0 3633 1 0 1 1 0 8 1 knotepl 120 110 0 0 4 0 4 4 0 8 0 kqueuepl 216 94 0 86 1 0 1 1 0 8 0 pipepl 336 274 0 246 8 0 8 8 0 8 5 fdescpl 496 1585 0 1549 7 2 5 6 0 8 0 filepl 152 4170 0 3930 17 0 17 17 0 8 7 lockfpl 104 30 0 28 1 0 1 1 0 8 0 lockfspl 48 16 0 14 1 0 1 1 0 8 0 sessionpl 144 23 0 7 1 0 1 1 0 8 0 pgrppl 48 29 0 13 1 0 1 1 0 8 0 ucredpl 96 271 0 253 1 0 1 1 0 8 0 zombiepl 144 1549 0 1549 1 0 1 1 0 8 1 processpl 1064 1599 0 1549 5 1 4 4 0 8 0 procpl 672 2951 0 2891 7 0 7 7 0 8 1 sockpl 480 657 0 630 16 5 11 16 0 8 7 mcl64k 65536 6 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 7 0 0 1 0 1 1 0 8 0 mcl4k 4096 6 0 0 1 0 1 1 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 144 0 0 17 0 17 17 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 332 0 0 21 0 21 21 0 8 0 bufpl 288 4812 0 133 335 0 335 335 0 8 0 anonpl 24 368859 0 355513 111 5 106 107 0 186 13 amapchunkpl 152 40221 0 39466 43 2 41 41 0 158 7 amappl16 200 3119 0 2769 31 1 30 30 0 8 7 amappl15 192 245 0 238 1 0 1 1 0 8 0 amappl14 184 3 0 1 2 1 1 1 0 8 0 amappl13 176 88 0 84 1 0 1 1 0 8 0 amappl12 168 477 0 468 1 0 1 1 0 8 0 amappl11 160 198 0 186 1 0 1 1 0 8 0 amappl10 152 193 0 189 1 0 1 1 0 8 0 amappl9 144 629 0 623 1 0 1 1 0 8 0 amappl8 136 702 0 655 2 0 2 2 0 8 0 amappl7 128 261 0 251 1 0 1 1 0 8 0 amappl6 120 370 0 346 2 1 1 2 0 8 0 amappl5 112 1101 0 1080 1 0 1 1 0 8 0 amappl4 104 1093 0 1064 2 0 2 2 0 8 0 amappl3 96 636 0 616 1 0 1 1 0 8 0 amappl2 88 847 0 800 3 1 2 3 0 8 0 amappl1 80 28708 0 28092 19 4 15 18 0 8 1 amappl 88 16603 0 16357 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 14 0 1 1 0 1 1 0 8 0 uaddrrnd 24 1585 0 1549 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1585 0 1549 1 0 1 1 0 8 0 vmmpekpl 168 13974 0 13934 3 0 3 3 0 8 0 vmmpepl 168 140689 0 138092 149 16 133 149 0 357 16 vmsppl 368 1584 0 1549 5 1 4 5 0 8 0 rwobjpl 56 34578 0 30449 61 1 60 60 0 8 0 pdppl 4096 3177 0 3098 109 28 81 97 0 8 2 pvpl 32 725299 0 706875 260 22 238 258 0 265 70 pmappl 248 1584 0 1549 4 1 3 3 0 8 0 extentpl 40 58 0 38 1 0 1 1 0 8 0 phpool 112 741 0 41 21 0 21 21 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(fffffd806a899ba8,1,0) at witness_checkorder+0x10b7 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd806a899ba8,1,0) at witness_checkorder+0x10b7 sys/kern/subr_witness.c:1105 rw_enter_read(fffffd806a899b98) at rw_enter_read+0x66 sys/kern/kern_rwlock.c:112 uvmfault_lookup(ffff80002e3718b0,0) at uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1758 uvm_fault_check(ffff80002e3718b0,ffff80002e3718e8,ffff80002e371910) at uvm_fault_check+0x3a sys/uvm/uvm_fault.c:674 uvm_fault(fffffd806a899b90,20000000,0,2) at uvm_fault+0x102 sys/uvm/uvm_fault.c:602 kpageflttrap(ffff80002e371a40,20000300) at kpageflttrap+0x209 kerntrap(ffff80002e371a40) 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,ffff80002e371cf0) at ifioctl_get+0x2dd soo_ioctl(fffffd8068f7f1e8,c0106924,ffff80002e371cf0,ffff8000294fe540) at soo_ioctl+0x26c sys_ioctl(ffff8000294fe540,ffff80002e371e08,ffff80002e371e60) at sys_ioctl+0x4a2 syscall(ffff80002e371ed0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002e371ed0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x760db89d120, 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+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff829de780) at __mp_lock+0x122 sys/kern/kern_lock.c:147 kqueue_scan(ffff8000211bbd90,8,ffff8000211bbe90,ffff8000211bbf90,ffff800021142a88,ffff8000211bbfec) at kqueue_scan+0xdb sys/kern/kern_event.c:1301 sys_kevent(ffff800021142a88,ffff8000211bc050,ffff8000211bc0b0) at sys_kevent+0x48b sys/kern/kern_event.c:988 syscall(ffff8000211bc120) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000211bc120) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffc83d0, count: -8