witness: userret: returning with the following locks held: shared rwlock netlock r = 0 (0xffffffff83801090) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1160 #1 rw_do_enter_read+0x36e sys/kern/kern_rwlock.c:397 #2 sysctl_file+0x1dc4 sys/kern/kern_sysctl.c:1773 #3 kern_sysctl+0x251 sys/kern/kern_sysctl.c:526 #4 OpenBSD/amd64 (ci-openbsd-setuid-2.us-central1-b.c.syzkaller.iynternal) (tty00)s_s login: ysctl+0x3f2 #5 syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline] #5 syscall+0xbc6 sys/arch/amd64/amd64/trap.c:579 #6 Xsyscall+0x128 panic: witness_warn Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 437068 87980 32767 0x10 0x4000000 0 syz-executor *383607 97341 32767 0x10 0x4000000 1 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff8338ac8d) at panic+0x1e5 sys/kern/subr_prf.c:198 witness_warn(2,0,ffffffff83349b2f) at witness_warn+0x850 witness_debugger sys/kern/subr_witness.c:2576 [inline] witness_warn(2,0,ffffffff83349b2f) at witness_warn+0x850 sys/kern/subr_witness.c:1485 userret(ffff80003c444028) at userret+0x3a4 sys/kern/kern_sig.c:2227 syscall(ffff80003c47fc10) at syscall+0x9c0 mi_syscall_return sys/sys/syscall_mi.h:203 [inline] syscall(ffff80003c47fc10) at syscall+0x9c0 sys/arch/amd64/amd64/trap.c:600 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe883e48ada0, 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{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic *cpu1: witness_warn ddb{1}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff8338ac8d) at panic+0x1e5 sys/kern/subr_prf.c:198 witness_warn(2,0,ffffffff83349b2f) at witness_warn+0x850 witness_debugger sys/kern/subr_witness.c:2576 [inline] witness_warn(2,0,ffffffff83349b2f) at witness_warn+0x850 sys/kern/subr_witness.c:1485 userret(ffff80003c444028) at userret+0x3a4 sys/kern/kern_sig.c:2227 syscall(ffff80003c47fc10) at syscall+0x9c0 mi_syscall_return sys/sys/syscall_mi.h:203 [inline] syscall(ffff80003c47fc10) at syscall+0x9c0 sys/arch/amd64/amd64/trap.c:600 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe883e48ada0, count: -6 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff80003c47f940 rbx 0xffff8000299dedd7 rdx 0xffff800001466b00 rcx 0xffff80003c444028 rax 0xffff8000299ddff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0xf66d559706b7a411 r11 0xd6548f8f2a325e4a r12 0xffff8000299debd8 r13 0 r14 0 r15 0x1 rip 0xffffffff828e9eb5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80003c47f930 ss 0 db_enter+0x25: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor) tid=383607 pid=97341 tcnt=2 stat=onproc flags process=10 proc=4000000 runpri=36, usrpri=86, slppri=36, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff8000ffff0f80,0xffff80003c445228 process=0xffff80003c4126e0 user=0xffff80003c47a000, vmspace=0xfffffd806bf463f0 estcpu=36, cpticks=10, pctcpu=0.0, user=0, sys=10, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 76823 136430 88024 32767 2 0x10 syz-executor 87980 449340 57088 32767 2 0x10 syz-executor 87980 437068 57088 32767 7 0x4000010 syz-executor 43917 281282 73545 0 2 0x2 syz-executor 97341 399859 78262 32767 2 0x10 syz-executor *97341 383607 78262 32767 7 0x4000010 syz-executor 7582 243600 63373 32767 3 0x90 nanoslp syz-executor 7582 310367 63373 32767 3 0x4000090 kqread syz-executor 7582 275635 63373 32767 3 0x4000090 fsleep syz-executor 89354 244588 60850 32767 3 0x90 nanoslp syz-executor 89354 118282 60850 32767 3 0x4000090 nanoslp syz-executor 89354 324521 60850 32767 3 0x4000090 fsleep syz-executor 29062 435391 0 0 3 0x14200 bored sosplice 57088 75870 36592 32767 3 0x90 nanoslp syz-executor 78262 342725 71157 32767 2 0xc90 syz-executor 65506 61013 52110 32767 3 0x90 nanoslp syz-executor 88024 182395 24589 32767 2 0xc90 syz-executor 63373 422550 27002 32767 2 0xc90 syz-executor 72266 362256 35297 32767 3 0x90 piperd syz-executor 60850 431628 45323 32767 2 0xc90 syz-executor 27002 339513 73545 0 3 0x82 wait syz-executor 71157 169586 73545 0 3 0x82 wait syz-executor 24589 451682 73545 0 3 0x82 wait syz-executor 36592 75788 73545 0 3 0x82 wait syz-executor 35297 222688 73545 0 3 0x82 wait syz-executor 52110 267178 73545 0 3 0x82 wait syz-executor 45323 246678 73545 0 3 0x82 wait syz-executor 73545 250014 80602 0 3 0x2 netlock syz-executor 80602 90145 37143 0 3 0x10008a sigsusp ksh 37143 421465 49306 0 3 0x98 kqread sshd-session 49306 21386 73142 0 3 0x92 kqread sshd-session 76929 517965 1 0 3 0x100083 ttyin getty 73142 350766 1 0 3 0x88 kqread sshd 48190 130680 10388 73 3 0x1100010 ffs_fsync syslogd 10388 447313 1 0 3 0x100082 sbwait syslogd 78383 154077 1 0 3 0x100080 kqread resolvd 42056 342741 53030 77 3 0x100092 kqread dhcpleased 94173 56851 53030 77 3 0x100092 kqread dhcpleased 53030 437149 1 0 3 0x80 kqread dhcpleased 88736 223496 0 0 3 0x14200 bored smr 30436 272322 0 0 2 0x14200 zerothread 42552 320156 0 0 3 0x14200 aiodoned aiodoned 85413 145683 0 0 3 0x14200 syncer update 87289 319331 0 0 3 0x14200 cleaner cleaner 80521 270886 0 0 3 0x14200 reaper reaper 61642 485106 0 0 3 0x14200 pgdaemon pagedaemon 55280 411661 0 0 3 0x14200 bored viomb 89421 302334 0 0 3 0x40014200 acpi0 acpi0 12625 33964 0 0 3 0x40014200 idle1 97554 305414 0 0 3 0x14200 bored softnet3 51996 484892 0 0 3 0x14200 bored softnet2 34187 486222 0 0 3 0x14200 bored softnet1 25046 28705 0 0 3 0x14200 netlock softnet0 91540 259543 0 0 3 0x14200 bored systqmp 47823 223757 0 0 3 0x14200 bored systq 22449 172601 0 0 3 0x14200 tmoslp softclockmp 30431 301656 0 0 3 0x40014200 tmoslp softclock 99906 9864 0 0 3 0x40014200 idle0 1 494181 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 97341 (syz-executor) thread 0xffff80003c444028 (383607) shared rwlock netlock r = 0 (0xffffffff83801090) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1160 #1 rw_do_enter_read+0x36e sys/kern/kern_rwlock.c:397 #2 sysctl_file+0x1dc4 sys/kern/kern_sysctl.c:1773 #3 kern_sysctl+0x251 sys/kern/kern_sysctl.c:526 #4 sys_sysctl+0x3f2 sys/kern/kern_sysctl.c:-1 #5 syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline] #5 syscall+0xbc6 sys/arch/amd64/amd64/trap.c:579 #6 Xsyscall+0x128 Process 73545 (syz-executor) thread 0xffff8000ffffd9a8 (250014) exclusive rwlock sbufsnd r = 0 (0xffff800010fde4c0) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1160 #1 rw_do_enter_write+0x377 sys/kern/kern_rwlock.c:310 #2 sblock+0xb7 sys/kern/uipc_socket2.c:536 #3 sosend+0x2e2 sys/kern/uipc_socket.c:630 #4 dofilewritev+0x23c sys/kern/sys_generic.c:380 #5 sys_write+0xa2 sys/kern/sys_generic.c:300 #6 syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline] #6 syscall+0xbc6 sys/arch/amd64/amd64/trap.c:579 #7 Xsyscall+0x128 Process 48190 (syslogd) thread 0xffff8000ffff3c40 (130680) exclusive rrwlock inode r = 0 (0xfffffd806eb3bac8) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1160 #1 rw_do_enter_write+0x377 sys/kern/kern_rwlock.c:310 #2 rrw_enter+0xc6 sys/kern/kern_rwlock.c:605 #3 VOP_LOCK+0xa6 sys/kern/vfs_vops.c:527 #4 vn_lock+0xa4 sys/kern/vfs_vnops.c:570 #5 sys_fsync+0x152 sys/kern/vfs_syscalls.c:2936 #6 syscall+0xb08 mi_syscall sys/sys/syscall_mi.h:176 [inline] #6 syscall+0xb08 sys/arch/amd64/amd64/trap.c:579 #7 Xsyscall+0x128 Process 25046 (softnet0) thread 0xffff8000ffffe290 (28705) shared rwlock softnet0 r = 0 (0xffff80000002c078) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1160 #1 taskq_thread+0x12a sys/kern/kern_task.c:442 #2 proc_trampoline+0x10 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10185 10952K 10966K 166960K 11265 0 pcb 17 12K 12K 166960K 17 0 rtable 212 6K 7K 166960K 366 0 pf 29 16K 16K 166960K 31 0 ifaddr 38 6K 7K 166960K 44 0 ifgroup 46 2K 2K 166960K 50 0 sysctl 1 1K 9K 166960K 6 0 counters 66 36K 36K 166960K 68 0 ioctlops 0 0K 2K 166960K 33 0 iov 0 0K 16K 166960K 10 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1335 84K 84K 166960K 1381 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 4 0 VM map 2 1K 1K 166960K 2 0 sem 12 0K 0K 166960K 17 0 dirhash 12 2K 2K 166960K 18 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 23 85K 125K 166960K 312 0 sigio 0 0K 0K 166960K 3 0 proc 58 79K 115K 166960K 495 0 subproc 72 4K 4K 166960K 81 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 3 0K 0K 166960K 47 0 in_multi 91 6K 7K 166960K 109 0 ether_multi 1 0K 0K 166960K 3 0 mrt 1 0K 0K 166960K 1 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 55 254K 254K 166960K 55 0 exec 0 0K 1K 166960K 407 0 fusefs mount 1 32K 32K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 239 176K 205K 166960K 4430 0 UVM aobj 14 2K 2K 166960K 14 0 pinsyscall 44 88K 110K 166960K 1344 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 7 0 NDP 10 0K 2K 166960K 27 0 temp 40 8687K 8751K 166960K 4550 0 kqueue 15 24K 36K 166960K 70 0 SYN cache 2 16K 16K 166960K 2 0 ddb{1}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 26 0 0 1 0 1 1 0 8 0 rtpcb 120 55 0 51 1 0 1 1 0 8 0 rtentry 176 113 0 14 6 0 6 6 0 8 1 unpcb 144 169 0 153 2 0 2 2 0 8 1 syncache 336 6 0 6 1 0 1 1 0 8 1 tcpqe 32 1 0 1 1 0 1 1 0 8 1 tcpcb 808 74 0 63 2 0 2 2 0 8 0 arp 128 18 0 2 1 0 1 1 0 8 0 ipq 40 1 0 0 1 0 1 1 0 8 0 ipqe 40 4 0 3 1 0 1 1 0 8 0 inpcb 328 243 0 227 4 0 4 4 0 8 2 nd6 144 26 0 5 1 0 1 1 0 8 0 kcovpl 48 8 0 1 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 457 0 49 29 0 29 29 0 8 2 art_table 32 458 0 49 4 0 4 4 0 8 0 art_node 16 112 0 22 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 3 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 14 0 4 1 0 1 1 0 8 0 shmpl 112 11 0 0 1 0 1 1 0 8 0 dirhash 1024 21 0 4 3 0 3 3 0 8 0 dino2pl 256 1805 0 296 95 0 95 95 0 8 0 ffsino 288 1805 0 296 108 0 108 108 0 8 0 nchpl 144 2262 0 584 63 0 63 63 0 8 0 uvmvnodes 80 1895 0 0 39 0 39 39 0 8 0 vnodes 216 1895 0 0 106 0 106 106 0 8 0 namei 1024 6781 0 6781 1 0 1 1 0 8 1 percpumem 16 49 0 1 1 0 1 1 0 8 0 kstatmem 264 24 0 2 2 0 2 2 0 8 0 scxspl 216 7292 0 7291 3 2 1 2 1 8 0 plimitpl 152 56 0 33 2 0 2 2 0 8 1 sigapl 424 592 0 538 8 0 8 8 0 8 1 knotepl 120 310 0 0 10 0 10 10 0 8 0 kqueuepl 224 84 0 72 2 0 2 2 0 8 1 pipepl 336 122 0 94 3 0 3 3 0 8 0 fdescpl 520 573 0 538 4 0 4 4 0 8 0 filepl 160 2387 0 2168 11 0 11 11 0 8 1 lockfpl 104 42 0 39 1 0 1 1 0 8 0 lockfspl 48 20 0 17 1 0 1 1 0 8 0 sessionpl 144 23 0 8 1 0 1 1 0 8 0 pgrppl 48 35 0 12 1 0 1 1 0 8 0 ucredpl 104 291 0 273 1 0 1 1 0 8 0 zombiepl 144 539 0 538 1 0 1 1 0 8 0 processpl 1240 592 0 538 5 0 5 5 0 8 0 procpl 656 886 0 826 7 0 7 7 0 8 1 sosppl 168 4 0 4 1 0 1 1 0 8 1 sockpl 728 471 0 432 6 0 6 6 0 8 1 mcl64k 65536 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 126 0 0 16 0 16 16 0 8 0 mcl2k 2048 17 0 0 3 0 3 3 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 251 0 0 16 0 16 16 0 8 0 bufpl 280 2630 0 116 180 0 180 180 0 8 0 anonpl 32 7364 0 0 60 0 60 60 0 246 0 amapchunkpl 152 13532 0 13033 38 0 38 38 0 158 13 amappl16 200 2198 0 2177 14 3 11 14 0 8 8 amappl15 192 35 0 35 1 1 0 1 0 8 0 amappl14 184 108 0 98 1 0 1 1 0 8 0 amappl13 176 7 0 7 1 1 0 1 0 8 0 amappl12 168 1180 0 1146 3 1 2 3 0 8 0 amappl11 160 46 0 36 1 0 1 1 0 8 0 amappl10 152 2 0 2 1 1 0 1 0 8 0 amappl9 144 274 0 274 1 1 0 1 0 8 0 amappl8 136 20 0 19 1 0 1 1 0 8 0 amappl7 128 119 0 109 1 0 1 1 0 8 0 amappl6 120 174 0 171 1 0 1 1 0 8 0 amappl5 112 116 0 110 1 0 1 1 0 8 0 amappl4 104 292 0 275 1 0 1 1 0 8 0 amappl3 96 2325 0 2210 4 0 4 4 0 8 0 amappl2 88 621 0 567 2 0 2 2 0 8 0 amappl1 80 8901 0 8339 14 0 14 14 0 8 0 amappl 88 3739 0 3567 5 0 5 5 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 13 0 0 1 0 1 1 0 8 0 uaddrrnd 24 573 0 538 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 573 0 538 1 0 1 1 0 8 0 vmmpekpl 168 6271 0 6235 2 0 2 2 0 8 0 vmmpepl 168 42845 0 40844 103 0 103 103 0 357 7 vmsppl 480 572 0 538 7 1 6 6 0 8 0 rwobjpl 72 16245 0 13517 52 0 52 52 0 8 0 pdppl 4096 1153 0 1076 115 30 85 97 0 8 8 pvpl 32 14904 0 0 121 0 121 121 0 265 0 pmappl 256 572 0 538 4 1 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 402 0 33 11 0 11 11 0 8 0 ddb{1}> machine ddbcpu 0