login: oLoLwitness: lock order reversal: 1st 0xfffffd806f73f5e8 inode (&ip->i_lock) 2nd 0xfffffd807a99b620 fdlock (&newfdp->fd_fd.fd_lock) lock order "&newfdp->fd_fd.fd_lock"(rwlock) -> "&ip->i_lock"(rrwlock) first seen at: #0 witness_checkorder+0x6a7 sys/kern/subr_witness.c:879 #1 rw_enter+0xd1 sys/kern/kern_rwlock.c:247 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_closefile+0x119 vn_lock sys/kern/vfs_vnops.c:561 [inline] #4 vn_closefile+0x119 vn_close sys/kern/vfs_vnops.c:288 [inline] #4 vn_closefile+0x119 sys/kern/vfs_vnops.c:587 #5 fdrop+0xc9 sys/kern/kern_descrip.c:1273 #6 closef+0x11d sys/kern/kern_descrip.c:1257 #7 finishdup+0x2b6 sys/kern/kern_descrip.c:686 #8 dodup3+0x5c5 sys/kern/kern_descrip.c:377 #9 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #9 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #10 Xsyscall+0x128 lock order "&ip->i_lock"(rrwlock) -> "&newfdp->fd_fd.fd_lock"(rwlock) first seen at: #0 witness_checkorder+0x6a7 sys/kern/subr_witness.c:879 #1 rw_enter_write+0x5b sys/kern/kern_rwlock.c:125 #2 diskmapioctl+0x237 sys/dev/diskmap.c:106 #3 VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 #4 vn_ioctl+0xb7 sys/kern/vfs_vnops.c:524 #5 sys_ioctl+0x5b8 #6 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #6 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #7 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:398 witness_checkorder(fffffd807a99b620,9,0) at witness_checkorder+0xffc witness_debugger sys/kern/subr_witness.c:2506 [inline] witness_checkorder(fffffd807a99b620,9,0) at witness_checkorder+0xffc sys/kern/subr_witness.c:1086 rw_enter_write(fffffd807a99b610) at rw_enter_write+0x5b sys/kern/kern_rwlock.c:125 diskmapioctl(5a00,c0106477,ffff80002279f040,1,ffff800020ace048) at diskmapioctl+0x237 sys/dev/diskmap.c:106 VOP_IOCTL(fffffd806fa704b8,c0106477,ffff80002279f040,1,fffffd807f7c6900,ffff800020ace048) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd807a7e8ab0,c0106477,ffff80002279f040,ffff800020ace048) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:524 sys_ioctl(ffff800020ace048,ffff80002279f158,ffff80002279f1c0) at sys_ioctl+0x5b8 syscall(ffff80002279f230) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff80002279f230) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1b,0,3,d75d3e3c1b0) at Xsyscall+0x128 end of kernel end trace frame: 0xd78ad7c5ec0, count: -9 ddb{1}> show registers rdi 0x3 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff80002279ec00 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800020f62000 rax 0xffff800000a81f40 r8 0xffffffff81c43405 witness_checkorder+0xfd5 r9 0x5 r10 0x3 r11 0x7eb95b5f9aacf9a6 r12 0xfffffd80029b9c00 r13 0 r14 0xffffffff825d0b70 w_lodata+0x41d40 r15 0xffffffff825e3050 w_lodata+0x54220 rip 0xffffffff8195cff8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002279ebf0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=475184 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=77, nice=20 forw=0xffffffffffffffff, list=0xffff800020ace7b0,0xffff800020ace2d0 process=0xffff800020adce00 user=0xffff80002279a000, vmspace=0xfffffd807f00c730 estcpu=27, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 31319 497768 27736 0 7 0 syz-executor.0 31319 268940 27736 0 2 0x4000000 syz-executor.0 31319 138227 27736 0 2 0x4000000 syz-executor.0 *31319 475184 27736 0 7 0x4000000 syz-executor.0 31319 53218 27736 0 2 0x4000000 syz-executor.0 69383 83695 1 0 3 0x100083 ttyin getty 27736 430655 56160 0 3 0x82 nanosleep syz-executor.0 51950 314124 56160 0 3 0x82 piperd syz-executor.1 91732 473136 0 0 3 0x14200 acct acct 37856 40442 0 0 3 0x14200 bored sosplice 56160 214271 55050 0 3 0x82 thrsleep syz-fuzzer 56160 180971 55050 0 3 0x4000082 thrsleep syz-fuzzer 56160 361766 55050 0 3 0x4000082 thrsleep syz-fuzzer 56160 507565 55050 0 3 0x4000082 thrsleep syz-fuzzer 56160 20693 55050 0 3 0x4000082 thrsleep syz-fuzzer 56160 511544 55050 0 3 0x4000082 kqread syz-fuzzer 56160 351434 55050 0 3 0x4000082 thrsleep syz-fuzzer 56160 226513 55050 0 3 0x4000082 thrsleep syz-fuzzer 56160 292729 55050 0 3 0x4000082 thrsleep syz-fuzzer 56160 388945 55050 0 3 0x4000082 thrsleep syz-fuzzer 55050 495874 13132 0 3 0x10008a pause ksh 13132 399311 39579 0 3 0x92 select sshd 39579 255354 1 0 3 0x80 select sshd 77674 247808 16702 74 3 0x100092 bpf pflogd 16702 96570 1 0 3 0x80 netio pflogd 22089 23363 53720 73 3 0x100090 kqread syslogd 53720 394848 1 0 3 0x100082 netio syslogd 23212 198518 1 77 3 0x100090 poll dhclient 46682 364762 1 0 3 0x80 poll dhclient 94680 63091 0 0 3 0x14200 pgzero zerothread 12931 281256 0 0 3 0x14200 aiodoned aiodoned 2618 218763 0 0 3 0x14200 syncer update 79110 435125 0 0 3 0x14200 cleaner cleaner 68906 95698 0 0 3 0x14200 reaper reaper 49773 105234 0 0 3 0x14200 pgdaemon pagedaemon 69134 61917 0 0 3 0x14200 bored crynlk 67198 447230 0 0 3 0x14200 bored crypto 56605 413072 0 0 3 0x40014200 acpi0 acpi0 98772 404599 0 0 3 0x40014200 idle1 48952 45100 0 0 3 0x14200 bored softnet 11188 496063 0 0 3 0x14200 bored systqmp 38851 187579 0 0 3 0x14200 bored systq 66060 356528 0 0 3 0x40014200 bored softclock 90797 230604 0 0 3 0x40014200 idle0 35713 294128 0 0 3 0x14200 bored smr 1 247223 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 31319 (syz-executor.0) thread 0xffff800020ace048 (475184) exclusive rrwlock inode r = 0 (0xfffffd806f73f5e8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x46d sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:561 #5 spec_open+0x431 sys/kern/spec_vnops.c:159 #6 VOP_OPEN+0x6a sys/kern/vfs_vops.c:153 #7 vn_open+0x495 sys/kern/vfs_vnops.c:174 #8 diskmapioctl+0x18e sys/dev/diskmap.c:91 #9 VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 #10 vn_ioctl+0xb7 sys/kern/vfs_vnops.c:524 #11 sys_ioctl+0x5b8 #12 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #12 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #13 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff826445e0) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 __mp_acquire_count+0x51 sys/kern/kern_lock.c:227 #2 mi_switch+0x38f sys/kern/sched_bsd.c:441 #3 sleep_finish+0x113 sys/kern/kern_synch.c:373 #4 rw_enter+0x366 sys/kern/kern_rwlock.c:282 #5 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #6 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #7 vn_lock+0x6e sys/kern/vfs_vnops.c:561 #8 spec_open+0x431 sys/kern/spec_vnops.c:159 #9 VOP_OPEN+0x6a sys/kern/vfs_vops.c:153 #10 vn_open+0x495 sys/kern/vfs_vnops.c:174 #11 diskmapioctl+0x18e sys/dev/diskmap.c:91 #12 VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 #13 vn_ioctl+0xb7 sys/kern/vfs_vnops.c:524 #14 sys_ioctl+0x5b8 #15 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #15 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #16 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9616 6470K 7180K 78643K 22271 0 0 pcb 13 8K 8K 78643K 483 0 0 rtable 111 4K 5K 78643K 1516 0 0 ifaddr 91 20K 21K 78643K 583 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1720 0 0 iov 0 0K 24K 78643K 427 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1204 76K 77K 78643K 5414 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 5K 78643K 66 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 1527 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 25K 78643K 4948 0 0 sigio 0 0K 0K 78643K 45 0 0 proc 54 51K 83K 78643K 1287 0 0 subproc 32 2K 2K 78643K 221 0 0 NFS srvsock 1 0K 0K 78643K 1 0 0 NFS daemon 1 16K 16K 78643K 1 0 0 ip_moptions 0 0K 0K 78643K 417 0 0 in_multi 33 2K 2K 78643K 292 0 0 ether_multi 1 0K 0K 78643K 19 0 0 mrt 0 0K 0K 78643K 9 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 96 424K 424K 78643K 96 0 0 exec 0 0K 1K 78643K 693 0 0 pfkey data 0 0K 0K 78643K 2 0 0 pagedep 1 8K 8K 78643K 1 0 0 inodedep 1 32K 32K 78643K 1 0 0 newblk 1 0K 0K 78643K 1 0 0 VM swap 7 26K 26K 78643K 7 0 0 UVM amap 100 21K 30K 78643K 16399 0 0 UVM aobj 130 4K 4K 78643K 143 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 1K 78643K 414 0 0 NDP 22 0K 0K 78643K 173 0 0 temp 243 3557K 3631K 78643K 61560 0 0 kqueue 0 0K 0K 78643K 47 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{1}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 28 0 22 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 203 0 201 1 0 1 1 0 8 0 rtentry 112 170 0 126 2 0 2 2 0 8 0 unpcb 120 1641 0 1631 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 9145 0 9145 1 1 0 1 0 8 0 tcpcb 544 1294 0 1290 1 0 1 1 0 8 0 inpcb 280 2856 0 2849 3 2 1 2 0 8 0 nd6 48 39 0 33 1 0 1 1 0 8 0 pkpcb 40 28 0 28 10 10 0 1 0 8 0 swfcl 56 5 0 0 1 0 1 1 0 8 0 ppxss 1128 93 0 93 13 12 1 1 0 8 1 pffrag 232 11 0 11 5 5 0 1 0 482 0 pffrnode 88 11 0 11 5 5 0 1 0 8 0 pffrent 40 28 0 28 5 5 0 1 0 8 0 pfosfp 40 846 0 423 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 131 0 101 1 0 1 1 0 8 0 pfstkey 112 131 0 101 1 0 1 1 0 8 0 pfstate 328 131 0 100 3 0 3 3 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 693 0 502 14 1 13 13 0 8 0 art_table 32 694 0 502 2 0 2 2 0 8 0 art_node 16 165 0 125 1 0 1 1 0 8 0 sysvmsgpl 40 21 0 9 1 0 1 1 0 8 0 semupl 112 3 0 3 1 1 0 1 0 8 0 semapl 112 1525 0 1515 1 0 1 1 0 8 0 shmpl 112 141 0 13 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 9276 0 7857 47 0 47 47 0 8 0 ffsino 272 9276 0 7857 96 0 96 96 0 8 0 nchpl 144 16563 0 14924 62 0 62 62 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 200 5926 0 0 312 0 312 312 0 8 0 namei 1024 50652 0 50652 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 11 0 11 9 8 1 1 0 8 1 scxspl 192 46702 0 46702 23 22 1 7 0 8 1 plimitpl 152 418 0 410 1 0 1 1 0 8 0 sigapl 432 5117 0 5102 3 1 2 3 0 8 0 futexpl 56 64560 0 64560 1 0 1 1 0 8 1 knotepl 112 969 0 950 1 0 1 1 0 8 0 kqueuepl 104 902 0 900 1 0 1 1 0 8 0 pipepl 112 2878 0 2859 10 8 2 2 0 8 1 fdescpl 488 5118 0 5102 3 0 3 3 0 8 0 filepl 152 29006 0 28900 15 9 6 7 0 8 1 lockfpl 104 1340 0 1340 2 1 1 1 0 8 1 lockfspl 48 471 0 471 2 1 1 1 0 8 1 sessionpl 112 31 0 20 1 0 1 1 0 8 0 pgrppl 48 78 0 67 1 0 1 1 0 8 0 ucredpl 96 4658 0 4649 1 0 1 1 0 8 0 zombiepl 144 5102 0 5102 2 1 1 1 0 8 1 processpl 896 5135 0 5102 4 0 4 4 0 8 0 procpl 632 15034 0 14988 10 5 5 5 0 8 0 srpgc 64 22 0 22 10 10 0 1 0 8 0 sosppl 128 49 0 49 9 9 0 1 0 8 0 sockpl 384 4764 0 4745 9 6 3 4 0 8 1 mcl64k 65536 16 0 0 2 0 2 2 0 8 0 mcl16k 16384 15 0 0 2 0 2 2 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 12 0 0 1 0 1 1 0 8 0 mcl8k 8192 5 0 0 1 0 1 1 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 166 0 0 20 1 19 20 0 8 0 mtagpl 80 29 0 0 1 0 1 1 0 8 0 mbufpl 256 321 0 0 12 0 12 12 0 8 0 bufpl 256 16114 0 9095 439 0 439 439 0 8 0 anonpl 16 431920 0 419248 150 91 59 68 0 124 3 amapchunkpl 152 29551 0 29439 49 39 10 18 0 158 4 amappl16 192 21743 0 21029 112 74 38 48 0 8 2 amappl15 184 1823 0 1821 1 0 1 1 0 8 0 amappl14 176 1855 0 1850 1 0 1 1 0 8 0 amappl13 168 624 0 622 4 3 1 1 0 8 0 amappl12 160 863 0 863 4 4 0 1 0 8 0 amappl11 152 318 0 303 1 0 1 1 0 8 0 amappl10 144 798 0 793 1 0 1 1 0 8 0 amappl9 136 1301 0 1298 1 0 1 1 0 8 0 amappl8 128 815 0 792 1 0 1 1 0 8 0 amappl7 120 782 0 775 1 0 1 1 0 8 0 amappl6 112 287 0 279 1 0 1 1 0 8 0 amappl5 104 1085 0 1072 1 0 1 1 0 8 0 amappl4 96 3056 0 3025 2 1 1 2 0 8 0 amappl3 88 4435 0 4425 1 0 1 1 0 8 0 amappl2 80 39941 0 39863 3 1 2 3 0 8 0 amappl1 72 117856 0 117404 27 17 10 20 0 8 0 amappl 80 15495 0 15455 1 0 1 1 0 84 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma64 64 259 0 259 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 17 0 17 1 1 0 1 0 8 0 aobjpl 64 142 0 13 3 0 3 3 0 8 0 uaddrrnd 24 5118 0 5102 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 5118 0 5102 1 0 1 1 0 8 0 vmmpekpl 168 37564 0 37526 2 0 2 2 0 8 0 vmmpepl 168 622151 0 620292 262 174 88 106 0 357 1 vmsppl 368 5117 0 5102 2 0 2 2 0 8 0 pdppl 4096 10243 0 10204 7 1 6 6 0 8 0 pvpl 32 1203306 0 1187380 324 175 149 169 0 265 15 pmappl 232 5117 0 5102 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 609 0 7 18 0 18 18 0 8 0