witness: thread 0xffff800020b38720 exiting with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd8068f264e0) locked @ /syzkaller/managers/pf/kernel/sys/ufs/ufs/ufs_vnops.c:1547 #0 witness_lock+0x594 sys/kern/subr_witness.c:1205 #1 _rw_enter+0x45d sys/kern/kern_rwlock.c:280 #2 _rrw_enter+0x60 sys/kern/kern_rwlock.c:410 #3 VOP_LOCK+0x57 sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:549 #5 spec_write+0xf8 sys/kern/spec_vnops.c:312 #6 VOP_WRITE+0x76 sys/kern/vfs_vops.c:268 #7 vn_write+0x1c2 sys/kern/vfs_vnops.c:397 #8 dofilewritev+0x1b0 sys/kern/sys_generic.c:364 #9 sys_write+0x92 sys/kern/sys_generic.c:284 #10 syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] #10 syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 #11 Xsyscall+0x128 panic: thread 0xffff800020b38720 cannot exit while holding sleeplocks Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 196321 87141 0 0 0x4000000 0 syz-executor.0 *371169 54535 0 0x14000 0x200 1 reaper db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 panic() at panic+0x174 sys/kern/subr_prf.c:208 witness_thread_exit(ffff800020b38720) at witness_thread_exit+0x283 sys/kern/subr_witness.c:1422 reaper(ffff800020ac19c8) at reaper+0x14f sys/kern/kern_exit.c:412 end trace frame: 0x0, count: 11 https://www.openbsd.org/ddb.html describes the minimum info required in bug reports. Insufficient info makes it difficult to find and fix bugs. ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic thread 0xffff800020b38720 cannot exit while holding sleeplocks ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 panic() at panic+0x174 sys/kern/subr_prf.c:208 witness_thread_exit(ffff800020b38720) at witness_thread_exit+0x283 sys/kern/subr_witness.c:1422 reaper(ffff800020ac19c8) at reaper+0x14f sys/kern/kern_exit.c:412 end trace frame: 0x0, count: -4 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff800020b0db00 rbx 0xffff800020b0dbb0 rdx 0xffffffff81f05f68 cmd0646_9_tim_udma+0xd1a rcx 0 rax 0 r8 0xffffffff81a188b3 kprintf+0x183 r9 0x1 r10 0x25 r11 0xb01eaf4cd7123c22 r12 0x3000000008 r13 0xffff800020b0db10 r14 0x100 r15 0x1 rip 0xffffffff81d05a08 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020b0daf0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (reaper) pid=371169 stat=onproc flags process=14000 proc=200 pri=4, usrpri=53, nice=20 forw=0xffffffffffffffff, list=0xffff800020ac1518,0xffff800020b159e0 process=0xffff800020afa698 user=0xffff800020b08000, vmspace=0xffffffff82359ae8 estcpu=3, cpticks=9, pctcpu=0.24 user=0, sys=7, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 87141 182658 31852 0 2 0 syz-executor.0 87141 398264 31852 0 2 0x4000000 syz-executor.0 87141 196321 31852 0 7 0x4000000 syz-executor.0 83214 13211 31828 0 2 0x3000 syz-executor.1 52592 500141 0 0 3 0x14200 bored sosplice 31828 371237 24710 0 3 0x82 nanosleep syz-executor.1 31852 116149 24710 0 3 0x82 nanosleep syz-executor.0 24710 14271 16412 0 3 0x82 thrsleep syz-fuzzer 24710 194099 16412 0 3 0x4000082 thrsleep syz-fuzzer 24710 372811 16412 0 3 0x4000082 thrsleep syz-fuzzer 24710 305838 16412 0 3 0x4000082 thrsleep syz-fuzzer 24710 455741 16412 0 3 0x4000082 thrsleep syz-fuzzer 24710 95077 16412 0 3 0x4000082 thrsleep syz-fuzzer 24710 311811 16412 0 3 0x4000082 kqread syz-fuzzer 24710 240700 16412 0 3 0x4000082 thrsleep syz-fuzzer 24710 466574 16412 0 3 0x4000082 thrsleep syz-fuzzer 24710 34186 16412 0 3 0x4000082 thrsleep syz-fuzzer 24710 124630 16412 0 3 0x4000082 thrsleep syz-fuzzer 16412 410820 50085 0 3 0x10008a pause ksh 50085 2303 87532 0 3 0x92 select sshd 85210 34107 1 0 3 0x100083 ttyin getty 87532 470016 1 0 3 0x80 select sshd 90554 427839 61904 74 3 0x100092 bpf pflogd 61904 371876 1 0 3 0x80 netio pflogd 71413 422279 96950 73 3 0x100010 biowait syslogd 96950 388527 1 0 3 0x100082 netio syslogd 31330 85323 1 77 3 0x100090 poll dhclient 17100 359137 1 0 3 0x80 poll dhclient 65893 428516 0 0 2 0x14200 zerothread 42056 192345 0 0 3 0x14200 aiodoned aiodoned 47106 118119 0 0 3 0x14200 syncer update 30490 513195 0 0 3 0x14200 cleaner cleaner *54535 371169 0 0 7 0x14200 reaper 34658 422139 0 0 3 0x14200 pgdaemon pagedaemon 32785 163271 0 0 3 0x14200 bored crynlk 74827 205123 0 0 3 0x14200 bored crypto 7579 70673 0 0 3 0x40014200 acpi0 acpi0 23034 142996 0 0 3 0x40014200 idle1 15881 266109 0 0 3 0x14200 bored softnet 42625 74649 0 0 3 0x14200 bored systqmp 66708 422450 0 0 3 0x14200 bored systq 39440 486610 0 0 3 0x40014200 bored softclock 18993 393394 0 0 3 0x40014200 idle0 98281 407368 0 0 3 0x14200 bored smr 1 124692 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 87141 (syz-executor.0) thread 0xffff800020b399e0 (196321) exclusive rrwlock inode r = 0 (0xfffffd8068f26d60) locked @ /syzkaller/managers/pf/kernel/sys/ufs/ufs/ufs_ihash.c:140 #0 witness_lock+0x594 sys/kern/subr_witness.c:1205 #1 _rw_enter+0x45d sys/kern/kern_rwlock.c:280 #2 _rrw_enter+0x60 sys/kern/kern_rwlock.c:410 #3 ufs_ihashins+0x6d sys/ufs/ufs/ufs_ihash.c:140 #4 ffs_vget+0x143 sys/ufs/ffs/ffs_vfsops.c:1352 #5 ffs_inode_alloc+0x1cf sys/ufs/ffs/ffs_alloc.c:392 #6 ufs_makeinode+0xc2 sys/ufs/ufs/ufs_vnops.c:1832 #7 ufs_create+0x41 sys/ufs/ufs/ufs_vnops.c:152 #8 VOP_CREATE+0x70 sys/kern/vfs_vops.c:112 #9 vn_open+0x25a sys/kern/vfs_vnops.c:112 #10 doopenat+0x2ca sys/kern/vfs_syscalls.c:1045 #11 syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] #11 syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 #12 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806e4061a8) locked @ /syzkaller/managers/pf/kernel/sys/ufs/ufs/ufs_vnops.c:1547 #0 witness_lock+0x594 sys/kern/subr_witness.c:1205 #1 _rw_enter+0x45d sys/kern/kern_rwlock.c:280 #2 _rrw_enter+0x60 sys/kern/kern_rwlock.c:410 #3 VOP_LOCK+0x57 sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:549 #5 vfs_lookup+0xf5 sys/kern/vfs_lookup.c:387 #6 namei+0x4b2 sys/kern/vfs_lookup.c:224 #7 vn_open+0x157 sys/kern/vfs_vnops.c:103 #8 doopenat+0x2ca sys/kern/vfs_syscalls.c:1045 #9 syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] #9 syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 #10 Xsyscall+0x128 Process 71413 (syslogd) thread 0xffff800020b85078 (422279) exclusive rrwlock inode r = 0 (0xfffffd806ec24b38) locked @ /syzkaller/managers/pf/kernel/sys/ufs/ufs/ufs_vnops.c:1547 #0 witness_lock+0x594 sys/kern/subr_witness.c:1205 #1 _rw_enter+0x45d sys/kern/kern_rwlock.c:280 #2 _rrw_enter+0x60 sys/kern/kern_rwlock.c:410 #3 VOP_LOCK+0x57 sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:549 #5 sys_fsync+0x114 sys/kern/vfs_syscalls.c:2704 #6 syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] #6 syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 #7 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9491 6396K 6409K 78643K 10622 0 0 pcb 25 9K 10K 78643K 151 0 0 rtable 100 3K 4K 78643K 205 0 0 ifaddr 49 11K 12K 78643K 62 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1471 0 0 iov 0 0K 12K 78643K 18 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1200 75K 75K 78643K 1279 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 3 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 36 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12628 0 0 file desc 6 17K 21K 78643K 168 0 0 sigio 0 0K 0K 78643K 8 0 0 proc 53 50K 71K 78643K 347 0 0 subproc 64 65538K 67586K 78643K 68 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 18 0 0 in_multi 33 2K 2K 78643K 52 0 0 ether_multi 1 0K 0K 78643K 3 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 48 212K 212K 78643K 48 0 0 exec 0 0K 1K 78643K 197 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 92 21K 29K 78643K 1389 0 0 UVM aobj 19 2K 2K 78643K 21 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 0K 78643K 1 0 0 NDP 9 0K 0K 78643K 16 0 0 temp 117 2366K 2430K 78643K 3473 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 4 0 0 1 0 1 1 0 8 0 inpcbpl 280 103 0 96 1 0 1 1 0 8 0 plimitpl 152 16 0 8 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 41 0 1 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 714 0 714 1 1 0 1 0 8 0 tcpcb 544 34 0 30 1 0 1 1 0 8 0 nd6 48 4 0 0 1 0 1 1 0 8 0 ppxss 1128 2 0 2 1 0 1 1 0 8 1 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 14 0 3 1 0 1 1 0 8 0 pfstkey 112 14 0 3 1 0 1 1 0 8 0 pfstate 328 14 0 3 1 0 1 1 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 185 0 0 12 0 12 12 0 8 0 art_table 32 186 0 0 2 0 2 2 0 8 0 art_node 16 40 0 6 1 0 1 1 0 8 0 sysvmsgpl 40 2 0 2 1 0 1 1 0 8 1 semapl 112 34 0 24 1 0 1 1 0 8 0 shmpl 112 19 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1704 0 288 46 0 46 46 0 8 0 ffsino 272 1704 0 288 95 0 95 95 0 8 0 nchpl 144 2137 0 509 61 0 61 61 0 8 0 uvmvnodes 72 1758 0 0 32 0 32 32 0 8 0 vnodes 200 1758 0 0 93 0 93 93 0 8 0 namei 1024 5860 0 5859 3 2 1 1 0 8 0 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 5296 0 5295 9 7 2 5 0 8 1 sigapl 432 364 0 348 2 0 2 2 0 8 0 futexpl 56 1726 0 1726 1 0 1 1 0 8 1 knotepl 112 95 0 68 2 1 1 2 0 8 0 kqueuepl 104 43 0 41 1 0 1 1 0 8 0 pipepl 112 226 0 207 2 1 1 1 0 8 0 fdescpl 488 365 0 348 3 0 3 3 0 8 0 filepl 152 2009 0 1901 6 1 5 5 0 8 0 lockfpl 104 38 0 38 2 1 1 1 0 8 1 lockfspl 32 35 0 35 2 1 1 1 0 8 1 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 19 0 8 1 0 1 1 0 8 0 ucredpl 96 333 0 324 1 0 1 1 0 8 0 zombiepl 144 349 0 348 3 2 1 1 0 8 0 processpl 840 381 0 348 4 0 4 4 0 8 0 procpl 600 738 0 692 4 0 4 4 0 8 0 sosppl 128 3 0 3 1 0 1 1 0 8 1 sockpl 384 227 0 208 4 1 3 3 0 8 1 mcl64k 65536 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 114 0 0 13 0 13 13 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 136 0 0 7 0 7 7 0 8 0 bufpl 256 5608 0 1043 286 0 286 286 0 8 0 anonpl 16 40125 0 32511 41 2 39 39 0 125 8 amapchunkpl 152 1752 0 1652 11 2 9 9 0 158 5 amappl16 192 1135 0 739 21 0 21 21 0 8 1 amappl15 184 3 0 1 1 0 1 1 0 8 0 amappl14 176 25 0 22 1 0 1 1 0 8 0 amappl13 168 101 0 96 1 0 1 1 0 8 0 amappl12 160 85 0 82 2 1 1 1 0 8 0 amappl11 152 214 0 200 1 0 1 1 0 8 0 amappl10 144 69 0 64 1 0 1 1 0 8 0 amappl9 136 366 0 363 1 0 1 1 0 8 0 amappl8 128 203 0 189 1 0 1 1 0 8 0 amappl7 120 99 0 95 1 0 1 1 0 8 0 amappl6 112 57 0 48 1 0 1 1 0 8 0 amappl5 104 110 0 96 1 0 1 1 0 8 0 amappl4 96 308 0 285 1 0 1 1 0 8 0 amappl3 88 127 0 121 1 0 1 1 0 8 0 amappl2 80 2166 0 2100 3 1 2 2 0 8 0 amappl1 72 17451 0 16963 24 14 10 19 0 8 0 amappl 72 967 0 925 1 0 1 1 0 75 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 20 0 2 1 0 1 1 0 8 0 uaddrrnd 24 365 0 348 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 365 0 348 1 0 1 1 0 8 0 vmmpekpl 168 7057 0 7034 2 0 2 2 0 8 0 vmmpepl 168 45358 0 43834 114 47 67 74 0 357 0 vmsppl 360 364 0 348 2 0 2 2 0 8 0 pdppl 4096 738 0 696 6 0 6 6 0 8 0 pvpl 32 150029 0 139065 144 31 113 113 0 265 24 pmappl 224 364 0 348 2 1 1 2 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 434 0 5 13 0 13 13 0 8 0