witness: userret: returning with the following locks held: exclusive rrwlock inode r = 0 (0xfffffd806f1a7918) #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_seek+0xc9 vn_lock sys/kern/vfs_vnops.c:561 [inline] #4 vn_seek+0xc9 sys/kern/vfs_vnops.c:611 #5 sys_lseek+0x6f sys/kern/vfs_syscalls.c:1859 #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 panic: witness_warn Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 43333 92804 32767 0x10 0x4000000 0 syz-executor.1 91306 81245 73 0x100010 0 1K syslogd db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 witness_warn(2,0,ffffffff81fbf610) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff81fbf610) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020b29658) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff80002504af80) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff80002504af80) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,0,ffffffffffffff88,0,4,5a0769bd1b0) at Xsyscall+0x128 end of kernel end trace frame: 0x5a367b57ca0, count: 9 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{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic witness_warn ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 witness_warn(2,0,ffffffff81fbf610) at witness_warn+0x69e witness_debugger sys/kern/subr_witness.c:2509 [inline] witness_warn(2,0,ffffffff81fbf610) at witness_warn+0x69e sys/kern/subr_witness.c:1454 userret(ffff800020b29658) at userret+0x36a sys/kern/kern_sig.c:1916 syscall(ffff80002504af80) at syscall+0x44a mi_syscall_return sys/sys/syscall_mi.h:115 [inline] syscall(ffff80002504af80) at syscall+0x44a sys/arch/amd64/amd64/trap.c:577 Xsyscall(6,0,ffffffffffffff88,0,4,5a0769bd1b0) at Xsyscall+0x128 end of kernel end trace frame: 0x5a367b57ca0, count: -6 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff80002504acc0 rbx 0xffff80002504ad70 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff80002321e000 rax 0xffff8000009efd40 r8 0xffffffff81e5e943 kprintf+0x173 r9 0x1 r10 0x25 r11 0xbe1d00e6add2cf6a r12 0x3000000008 r13 0xffff80002504acd0 r14 0x100 r15 0x1 rip 0xffffffff81a908f8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002504acb0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=43333 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=81, nice=20 forw=0xffffffffffffffff, list=0xffff800020b28020,0xffff800020b298e0 process=0xffff800020b7c380 user=0xffff800025046000, vmspace=0xfffffd807f00c000 estcpu=31, cpticks=4, pctcpu=0.0 user=0, sys=4, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 924 413216 13722 32767 2 0x10 syz-executor.0 924 1327 13722 32767 2 0x4000010 syz-executor.0 92804 300800 1932 32767 2 0x10 syz-executor.1 92804 249979 1932 32767 3 0x4000090 fsleep syz-executor.1 92804 10369 1932 32767 2 0x4000010 syz-executor.1 *92804 43333 1932 32767 7 0x4000010 syz-executor.1 1932 455061 83819 32767 2 0x490 syz-executor.1 83819 170025 95519 0 3 0x82 wait syz-executor.1 13722 216363 25816 32767 3 0x90 nanosleep syz-executor.0 25816 249452 95519 0 3 0x82 wait syz-executor.0 99589 93117 0 0 3 0x14200 bored sosplice 95519 78444 26041 0 3 0x82 thrsleep syz-fuzzer 95519 119115 26041 0 3 0x4000082 thrsleep syz-fuzzer 95519 415182 26041 0 3 0x4000082 thrsleep syz-fuzzer 95519 309722 26041 0 3 0x4000082 thrsleep syz-fuzzer 95519 471884 26041 0 3 0x4000082 thrsleep syz-fuzzer 95519 272197 26041 0 3 0x4000082 thrsleep syz-fuzzer 95519 396221 26041 0 3 0x4000082 thrsleep syz-fuzzer 95519 157514 26041 0 3 0x4000082 thrsleep syz-fuzzer 95519 511339 26041 0 2 0x4000082 syz-fuzzer 95519 140865 26041 0 3 0x4000082 thrsleep syz-fuzzer 26041 478648 56147 0 3 0x10008a pause ksh 56147 165603 73120 0 3 0x92 select sshd 26724 228147 1 0 3 0x100083 ttyin getty 73120 339944 1 0 3 0x80 select sshd 81245 91306 32079 73 7 0x100010 syslogd 32079 112467 1 0 3 0x100082 netio syslogd 95452 43132 1 77 3 0x100090 poll dhclient 35826 496822 1 0 3 0x80 poll dhclient 99757 293864 0 0 2 0x14200 zerothread 81337 475168 0 0 3 0x14200 aiodoned aiodoned 48464 172435 0 0 3 0x14200 syncer update 68993 71381 0 0 3 0x14200 cleaner cleaner 86747 280026 0 0 3 0x14200 reaper reaper 10926 249509 0 0 3 0x14200 pgdaemon pagedaemon 30576 370820 0 0 3 0x14200 bored crynlk 42643 10265 0 0 3 0x14200 bored crypto 57499 99279 0 0 3 0x40014200 acpi0 acpi0 11069 325272 0 0 3 0x40014200 idle1 38924 81413 0 0 3 0x14200 bored softnet 16212 207051 0 0 3 0x14200 bored systqmp 26441 427701 0 0 3 0x14200 bored systq 69255 263264 0 0 2 0x40014200 softclock 89051 53996 0 0 3 0x40014200 idle0 85137 514403 0 0 3 0x14200 bored smr 1 281745 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks CPU 1: exclusive mutex /syzkaller/managers/setuid/kernel/sys/kern/kern_timeout.c:94 r = 0 (0xffffffff8225f8f0) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 mtx_enter_try+0x102 #2 mtx_enter+0x4b sys/kern/kern_lock.c:266 #3 timeout_del_barrier+0x5f timeout_del sys/kern/kern_timeout.c:367 [inline] #3 timeout_del_barrier+0x5f sys/kern/kern_timeout.c:387 #4 tsleep+0x1d4 sleep_finish_timeout sys/kern/kern_synch.c:405 [inline] #4 tsleep+0x1d4 sleep_finish_all sys/kern/kern_synch.c:183 [inline] #4 tsleep+0x1d4 sys/kern/kern_synch.c:152 #5 biowait+0xa1 sys/kern/vfs_bio.c:1231 #6 bwrite+0x1e1 sys/kern/vfs_bio.c:747 #7 ffs_update+0x2c2 sys/ufs/ffs/ffs_inode.c:113 #8 VOP_FSYNC+0xc7 sys/kern/vfs_vops.c:352 #9 sys_fsync+0x128 sys/kern/vfs_syscalls.c:2806 #10 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #10 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #11 Xsyscall+0x128 Process 924 (syz-executor.0) thread 0xffff800020b28c78 (1327) exclusive rrwlock inode r = 0 (0xfffffd8064de76f8) #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 ufs_ihashins+0x45 sys/ufs/ufs/ufs_ihash.c:140 #4 ffs_vget+0x13e sys/ufs/ffs/ffs_vfsops.c:1352 #5 ffs_inode_alloc+0x1cf sys/ufs/ffs/ffs_alloc.c:392 #6 ufs_makeinode+0xaa sys/ufs/ufs/ufs_vnops.c:1832 #7 ufs_symlink+0x47 sys/ufs/ufs/ufs_vnops.c:1384 #8 VOP_SYMLINK+0xe0 sys/kern/vfs_vops.c:497 #9 dosymlinkat+0x160 sys/kern/vfs_syscalls.c:1739 #10 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #10 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #11 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806f1a7918) #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 vfs_lookup+0xec sys/kern/vfs_lookup.c:418 #6 namei+0x61c sys/kern/vfs_lookup.c:248 #7 dosymlinkat+0xba sys/kern/vfs_syscalls.c:1725 #8 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #8 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #9 Xsyscall+0x128 Process 92804 (syz-executor.1) thread 0xffff800020b29658 (43333) exclusive rrwlock inode r = 0 (0xfffffd806f1a7918) #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_seek+0xc9 vn_lock sys/kern/vfs_vnops.c:561 [inline] #4 vn_seek+0xc9 sys/kern/vfs_vnops.c:611 #5 sys_lseek+0x6f sys/kern/vfs_syscalls.c:1859 #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 Process 81245 (syslogd) thread 0xffff800020b609f0 (91306) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82392d30) #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 tsleep+0x198 sleep_finish_timeout sys/kern/kern_synch.c:397 [inline] #4 tsleep+0x198 sleep_finish_all sys/kern/kern_synch.c:183 [inline] #4 tsleep+0x198 sys/kern/kern_synch.c:152 #5 biowait+0xa1 sys/kern/vfs_bio.c:1231 #6 bwrite+0x1e1 sys/kern/vfs_bio.c:747 #7 ffs_update+0x2c2 sys/ufs/ffs/ffs_inode.c:113 #8 VOP_FSYNC+0xc7 sys/kern/vfs_vops.c:352 #9 sys_fsync+0x128 sys/kern/vfs_syscalls.c:2806 #10 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #10 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #11 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806eba24d8) #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 sys_fsync+0x114 sys/kern/vfs_syscalls.c:2806 #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 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9463 6322K 6322K 78643K 11745 0 0 pcb 13 8K 8K 78643K 13 0 0 rtable 105 3K 3K 78643K 10951 0 0 ifaddr 35 13K 15K 78643K 1496 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 640 0 0 iov 0 0K 28K 78643K 1160 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 76K 78643K 7252 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 137 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 1464 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 8 25K 33K 78643K 13830 0 0 sigio 0 0K 0K 78643K 171 0 0 proc 41 38K 70K 78643K 11348 0 0 subproc 34 2K 2K 78643K 4097 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 1677 0 0 in_multi 33 2K 2K 78643K 3036 0 0 ether_multi 1 0K 0K 78643K 72 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 66 291K 291K 78643K 66 0 0 exec 0 0K 1K 78643K 4182 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 115 22K 32K 78643K 46934 0 0 UVM aobj 130 4K 5K 78643K 160 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 869 0 0 NDP 5 0K 0K 78643K 726 0 0 temp 121 2750K 2846K 78643K 59748 0 0 kqueue 0 0K 0K 78643K 145 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 487 0 481 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 1148 0 1146 1 0 1 1 0 8 0 rtentry 112 2677 0 2633 2 0 2 2 0 8 0 unpcb 120 5462 0 5454 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 3667 0 3667 1 1 0 1 0 8 0 tcpcb 544 3019 0 3015 1 0 1 1 0 8 0 ipq 40 4 0 4 3 3 0 1 0 8 0 ipqe 40 10 0 10 3 3 0 1 0 8 0 inpcb 280 7539 0 7530 29 28 1 2 0 8 0 nd6 48 723 0 717 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 10964 0 10772 25 13 12 13 0 8 0 art_table 32 10965 0 10772 2 0 2 2 0 8 0 art_node 16 2676 0 2636 1 0 1 1 0 8 0 sysvmsgpl 40 34 0 12 1 0 1 1 0 8 0 semapl 112 1461 0 1451 1 0 1 1 0 8 0 shmpl 112 158 0 30 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 15578 0 14126 47 0 47 47 0 8 0 ffsino 272 15578 0 14126 97 0 97 97 0 8 0 nchpl 144 31867 0 30235 61 0 61 61 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 135800 0 135798 4 3 1 1 0 8 0 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 95136 0 95135 60 56 4 6 0 8 3 plimitpl 152 2435 0 2426 1 0 1 1 0 8 0 sigapl 432 13284 0 13268 12 10 2 3 0 8 0 futexpl 56 124225 0 124224 3 2 1 1 0 8 0 knotepl 112 7606 0 7587 1 0 1 1 0 8 0 kqueuepl 104 3132 0 3130 1 0 1 1 0 8 0 pipepl 112 8914 0 8895 24 23 1 2 0 8 0 fdescpl 488 13285 0 13268 3 0 3 3 0 8 0 filepl 152 82122 0 82019 35 30 5 7 0 8 0 lockfpl 104 2520 0 2520 17 16 1 1 0 8 1 lockfspl 48 828 0 828 17 16 1 1 0 8 1 sessionpl 112 256 0 246 1 0 1 1 0 8 0 pgrppl 48 374 0 364 1 0 1 1 0 8 0 ucredpl 96 23092 0 23083 1 0 1 1 0 8 0 zombiepl 144 13268 0 13268 6 5 1 1 0 8 1 processpl 896 13301 0 13268 4 0 4 4 0 8 0 procpl 632 36068 0 36022 40 35 5 5 0 8 1 srpgc 64 478 0 478 35 35 0 1 0 8 0 sosppl 128 269 0 269 50 50 0 1 0 8 0 sockpl 384 14423 0 14406 17 14 3 4 0 8 1 mcl64k 65536 41 0 0 6 3 3 3 0 8 0 mcl16k 16384 18 0 0 3 1 2 3 0 8 0 mcl12k 12288 41 0 0 3 1 2 2 0 8 0 mcl9k 9216 33 0 0 2 0 2 2 0 8 0 mcl8k 8192 25 0 0 3 0 3 3 0 8 0 mcl4k 4096 31 0 0 3 0 3 3 0 8 0 mcl2k2 2112 19 0 0 2 0 2 2 0 8 0 mcl2k 2048 163 0 0 16 5 11 16 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 831 0 0 13 0 13 13 0 8 0 bufpl 256 37164 0 30140 440 0 440 440 0 8 0 anonpl 16 1525679 0 1518399 166 120 46 47 0 125 3 amapchunkpl 152 108464 0 108374 218 200 18 18 0 158 13 amappl16 192 63793 0 63399 352 322 30 34 0 8 8 amappl15 184 2665 0 2660 26 25 1 1 0 8 0 amappl14 176 4481 0 4471 1 0 1 1 0 8 0 amappl13 168 1973 0 1973 22 22 0 1 0 8 0 amappl12 160 958 0 954 2 1 1 1 0 8 0 amappl11 152 2488 0 2476 1 0 1 1 0 8 0 amappl10 144 1655 0 1652 1 0 1 1 0 8 0 amappl9 136 4945 0 4942 1 0 1 1 0 8 0 amappl8 128 3795 0 3753 4 2 2 2 0 8 0 amappl7 120 1895 0 1886 1 0 1 1 0 8 0 amappl6 112 1823 0 1811 1 0 1 1 0 8 0 amappl5 104 2723 0 2714 1 0 1 1 0 8 0 amappl4 96 12682 0 12648 2 1 1 2 0 8 0 amappl3 88 5031 0 5014 1 0 1 1 0 8 0 amappl2 80 87859 0 87778 3 1 2 3 0 8 0 amappl1 72 366769 0 366306 35 25 10 19 0 8 0 amappl 80 40119 0 40081 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 159 0 30 3 0 3 3 0 8 0 uaddrrnd 24 13285 0 13268 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 13285 0 13268 1 0 1 1 0 8 0 vmmpekpl 168 109691 0 109661 2 0 2 2 0 8 0 vmmpepl 168 1713204 0 1711469 358 271 87 92 0 357 11 vmsppl 368 13284 0 13268 2 0 2 2 0 8 0 pdppl 4096 26577 0 26536 9 3 6 6 0 8 0 pvpl 32 4001747 0 3991165 593 468 125 127 0 265 24 pmappl 232 13284 0 13268 27 26 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 628 0 30 18 0 18 18 0 8 0