panic: kernel diagnostic assertion "timo || _kernel_lock_held()" failed: file "/syzkaller/managers/setuid/kernel/sys/kern/kern_synch.c", line 121 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 80735 22679 32767 0x10 0x4000000 1 syz-executor.0 49793 99148 32767 0x10 0x480 0 syz-executor.0 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 __assert(ffffffff81fb5b5c,ffffffff81fd515d,79,ffffffff81fc5830) at __assert+0x2e sys/kern/subr_prf.c:154 tsleep(fffffd8067e88950,8,ffffffff81fb40b2,0) at tsleep+0x3fb sleep_finish_all sys/kern/kern_synch.c:405 [inline] tsleep(fffffd8067e88950,8,ffffffff81fb40b2,0) at tsleep+0x3fb sys/kern/kern_synch.c:152 vn_seek(fffffd8007ab6390,ffff800024fe3608,0,ffff800020b293d8) at vn_seek+0xa0 vn_lock sys/kern/vfs_vnops.c:556 [inline] vn_seek(fffffd8007ab6390,ffff800024fe3608,0,ffff800020b293d8) at vn_seek+0xa0 sys/kern/vfs_vnops.c:611 sys_lseek(ffff800020b293d8,ffff800024fe3678,ffff800024fe36e0) at sys_lseek+0x6f sys/kern/vfs_syscalls.c:1859 syscall(ffff800024fe3750) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800024fe3750) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff87,0,4,267c1ede1b0) at Xsyscall+0x128 end of kernel end trace frame: 0x26a4b641300, count: 7 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}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic kernel diagnostic assertion "timo || _kernel_lock_held()" failed: file "/syzkaller/managers/setuid/kernel/sys/kern/kern_synch.c", line 121 ddb{1}> 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 __assert(ffffffff81fb5b5c,ffffffff81fd515d,79,ffffffff81fc5830) at __assert+0x2e sys/kern/subr_prf.c:154 tsleep(fffffd8067e88950,8,ffffffff81fb40b2,0) at tsleep+0x3fb sleep_finish_all sys/kern/kern_synch.c:405 [inline] tsleep(fffffd8067e88950,8,ffffffff81fb40b2,0) at tsleep+0x3fb sys/kern/kern_synch.c:152 vn_seek(fffffd8007ab6390,ffff800024fe3608,0,ffff800020b293d8) at vn_seek+0xa0 vn_lock sys/kern/vfs_vnops.c:556 [inline] vn_seek(fffffd8007ab6390,ffff800024fe3608,0,ffff800020b293d8) at vn_seek+0xa0 sys/kern/vfs_vnops.c:611 sys_lseek(ffff800020b293d8,ffff800024fe3678,ffff800024fe36e0) at sys_lseek+0x6f sys/kern/vfs_syscalls.c:1859 syscall(ffff800024fe3750) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800024fe3750) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff87,0,4,267c1ede1b0) at Xsyscall+0x128 end of kernel end trace frame: 0x26a4b641300, count: -8 ddb{1}> show registers rdi 0xffffffff811a7027 db_enter+0x17 rsi 0x2e88 __ALIGN_SIZE+0x1e88 rbp 0xffff800024fe3390 rbx 0xffff800024fe3440 rdx 0x2e89 __ALIGN_SIZE+0x1e89 rcx 0xffff8000231d8000 rax 0xffff8000231d8000 r8 0xffffffff81b1c663 kprintf+0x173 r9 0x1 r10 0x25 r11 0x3abf960d68d2a3f4 r12 0x3000000008 r13 0xffff800024fe33a0 r14 0x100 r15 0x1 rip 0xffffffff811a7028 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800024fe3380 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=80735 stat=onproc flags process=10 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b28018,0xffffffff823b68f8 process=0xffff800020b2ae10 user=0xffff800024fde000, vmspace=0xfffffd807effd2e0 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 22679 465914 99148 32767 2 0x10 syz-executor.0 22679 143914 99148 32767 3 0x4000090 fsleep syz-executor.0 22679 276513 99148 32767 2 0x4000010 syz-executor.0 *22679 80735 99148 32767 7 0x4000010 syz-executor.0 99148 49793 14222 32767 7 0x490 syz-executor.0 14222 393548 40584 0 3 0x82 wait syz-executor.0 14476 521790 8182 32767 2 0x10 syz-executor.1 8182 134711 40584 0 3 0x82 wait syz-executor.1 69119 70914 0 0 3 0x14200 bored sosplice 40584 108890 87720 0 3 0x82 thrsleep syz-fuzzer 40584 161324 87720 0 2 0x4000482 syz-fuzzer 40584 302925 87720 0 3 0x4000082 thrsleep syz-fuzzer 40584 230 87720 0 3 0x4000082 thrsleep syz-fuzzer 40584 373268 87720 0 3 0x4000082 thrsleep syz-fuzzer 40584 144142 87720 0 3 0x4000082 thrsleep syz-fuzzer 40584 26410 87720 0 3 0x4000082 thrsleep syz-fuzzer 40584 381116 87720 0 3 0x4000082 thrsleep syz-fuzzer 40584 493138 87720 0 3 0x4000082 thrsleep syz-fuzzer 40584 490239 87720 0 3 0x4000082 kqread syz-fuzzer 87720 65580 1805 0 3 0x10008a pause ksh 1805 423800 65074 0 3 0x92 select sshd 84087 381366 1 0 3 0x100083 ttyin getty 65074 450385 1 0 3 0x80 select sshd 94352 453411 26639 73 3 0x100090 kqread syslogd 26639 306505 1 0 3 0x100082 netio syslogd 64121 165702 1 77 3 0x100090 poll dhclient 11727 257615 1 0 3 0x80 poll dhclient 20220 282632 0 0 2 0x14200 zerothread 52577 172786 0 0 3 0x14200 aiodoned aiodoned 25599 15717 0 0 3 0x14200 syncer update 22763 170868 0 0 3 0x14200 cleaner cleaner 27029 504942 0 0 3 0x14200 reaper reaper 94394 270912 0 0 3 0x14200 pgdaemon pagedaemon 15908 92650 0 0 3 0x14200 bored crynlk 38973 452282 0 0 3 0x14200 bored crypto 27508 321107 0 0 3 0x40014200 acpi0 acpi0 97727 232448 0 0 3 0x40014200 idle1 44639 137699 0 0 3 0x14200 bored softnet 86594 400330 0 0 3 0x14200 bored systqmp 5065 228612 0 0 3 0x14200 bored systq 90435 56806 0 0 3 0x40014200 bored softclock 49025 201731 0 0 3 0x40014200 idle0 4228 153533 0 0 3 0x14200 bored smr 1 520523 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 22679 (syz-executor.0) thread 0xffff800020b28018 (276513) exclusive rwlock fdlock r = 0 (0xfffffd80696e5818) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 ptmioctl+0xe7 sys/kern/tty_pty.c:1071 #2 VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 #3 vn_ioctl+0xb7 sys/kern/vfs_vnops.c:524 #4 sys_ioctl+0x5b8 #5 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #5 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #6 Xsyscall+0x128 Process 14476 (syz-executor.1) thread 0xffff800020b289f8 (521790) exclusive rrwlock inode r = 0 (0xfffffd8068e06c58) #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 vget+0x1c3 sys/kern/vfs_subr.c:672 #6 ufs_ihashget+0x141 sys/ufs/ufs/ufs_ihash.c:119 #7 ffs_vget+0x74 sys/ufs/ffs/ffs_vfsops.c:1323 #8 ufs_lookup+0x1575 sys/ufs/ufs/ufs_lookup.c:487 #9 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 #10 vfs_lookup+0x7a5 sys/kern/vfs_lookup.c:567 #11 namei+0x61c sys/kern/vfs_lookup.c:248 #12 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1785 #13 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #13 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd80651541b8) #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 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1785 #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 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9464 6322K 6322K 78643K 12006 0 0 pcb 13 8K 8K 78643K 13 0 0 rtable 105 3K 3K 78643K 13284 0 0 ifaddr 35 17K 21K 78643K 1817 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 733 0 0 iov 0 0K 40K 78643K 1328 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 76K 78643K 8801 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 9K 78643K 231 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 1896 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 7 21K 33K 78643K 17497 0 0 sigio 0 0K 0K 78643K 202 0 0 proc 41 38K 70K 78643K 13769 0 0 subproc 34 2K 2K 78643K 4981 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 2148 0 0 in_multi 33 2K 2K 78643K 3827 0 0 ether_multi 1 0K 0K 78643K 117 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 72 318K 318K 78643K 72 0 0 exec 0 0K 1K 78643K 5217 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 96 21K 31K 78643K 58879 0 0 UVM aobj 130 5K 5K 78643K 146 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 1085 0 0 NDP 5 0K 0K 78643K 882 0 0 temp 121 2750K 2830K 78643K 73723 0 0 kqueue 0 0K 0K 78643K 275 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 590 0 584 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 1388 0 1384 1 0 1 1 0 8 0 rtentry 112 3248 0 3204 2 0 2 2 0 8 0 unpcb 120 7187 0 7179 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 4352 0 4352 1 1 0 1 0 8 0 tcpcb 544 3949 0 3945 1 0 1 1 0 8 0 ipq 40 9 0 9 7 7 0 1 0 8 0 ipqe 40 20 0 20 7 7 0 1 0 8 0 inpcb 280 9646 0 9637 22 20 2 2 0 8 1 nd6 48 879 0 873 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 13320 0 13126 27 14 13 13 0 8 0 art_table 32 13321 0 13126 2 0 2 2 0 8 0 art_node 16 3247 0 3207 1 0 1 1 0 8 0 sysvmsgpl 40 24 0 9 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 1892 0 1882 1 0 1 1 0 8 0 shmpl 112 144 0 16 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 19757 0 18276 53 5 48 48 0 8 0 ffsino 272 19757 0 18276 99 0 99 99 0 8 0 nchpl 144 40579 0 38950 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 170657 0 170657 4 3 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 117532 0 117532 50 49 1 6 0 8 1 plimitpl 152 2970 0 2961 1 0 1 1 0 8 0 sigapl 432 16795 0 16780 15 13 2 3 0 8 0 futexpl 56 157529 0 157528 4 3 1 1 0 8 0 knotepl 112 9557 0 9538 1 0 1 1 0 8 0 kqueuepl 104 4087 0 4085 1 0 1 1 0 8 0 pipepl 112 10896 0 10877 30 29 1 2 0 8 0 fdescpl 488 16796 0 16780 5 2 3 3 0 8 0 filepl 152 104269 0 104161 51 46 5 7 0 8 0 lockfpl 104 3292 0 3292 38 37 1 1 0 8 1 lockfspl 48 1035 0 1035 38 37 1 1 0 8 1 sessionpl 112 308 0 298 1 0 1 1 0 8 0 pgrppl 48 469 0 459 1 0 1 1 0 8 0 ucredpl 96 29478 0 29469 1 0 1 1 0 8 0 zombiepl 144 16780 0 16780 4 3 1 1 0 8 1 processpl 896 16812 0 16780 4 0 4 4 0 8 0 procpl 632 45866 0 45822 63 59 4 5 0 8 0 srpgc 64 582 0 582 75 74 1 1 0 8 1 sosppl 128 335 0 335 71 70 1 1 0 8 1 sockpl 384 18549 0 18530 30 27 3 4 0 8 1 mcl64k 65536 49 0 0 6 3 3 3 0 8 0 mcl16k 16384 21 0 0 3 1 2 3 0 8 0 mcl12k 12288 73 0 0 3 1 2 2 0 8 0 mcl9k 9216 68 0 0 4 2 2 2 0 8 0 mcl8k 8192 42 0 0 6 3 3 3 0 8 0 mcl4k 4096 25 0 0 3 0 3 3 0 8 0 mcl2k2 2112 12 0 0 1 0 1 1 0 8 0 mcl2k 2048 216 0 0 22 8 14 22 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 1178 0 0 12 1 11 12 0 8 0 bufpl 256 36477 0 29453 440 0 440 440 0 8 0 anonpl 16 1878391 0 1871845 373 330 43 47 0 125 1 amapchunkpl 152 135144 0 135056 282 273 9 18 0 158 4 amappl16 192 80678 0 80294 524 492 32 34 0 8 10 amappl15 184 1961 0 1956 1 0 1 1 0 8 0 amappl14 176 3718 0 3709 1 0 1 1 0 8 0 amappl13 168 2346 0 2346 27 27 0 1 0 8 0 amappl12 160 2363 0 2360 1 0 1 1 0 8 0 amappl11 152 3166 0 3155 1 0 1 1 0 8 0 amappl10 144 2785 0 2783 1 0 1 1 0 8 0 amappl9 136 5888 0 5885 1 0 1 1 0 8 0 amappl8 128 4699 0 4667 7 5 2 2 0 8 0 amappl7 120 3337 0 3327 1 0 1 1 0 8 0 amappl6 112 2445 0 2437 1 0 1 1 0 8 0 amappl5 104 3896 0 3887 1 0 1 1 0 8 0 amappl4 96 16304 0 16272 1 0 1 1 0 8 0 amappl3 88 4354 0 4343 1 0 1 1 0 8 0 amappl2 80 111728 0 111655 4 2 2 3 0 8 0 amappl1 72 458341 0 457895 23 13 10 19 0 8 0 amappl 80 50687 0 50651 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 145 0 16 3 0 3 3 0 8 0 uaddrrnd 24 16796 0 16780 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 16796 0 16780 1 0 1 1 0 8 0 vmmpekpl 168 140490 0 140464 2 0 2 2 0 8 0 vmmpepl 168 2154529 0 2152929 469 383 86 94 0 357 11 vmsppl 368 16795 0 16780 2 0 2 2 0 8 0 pdppl 4096 33600 0 33560 7 1 6 6 0 8 0 pvpl 32 4981194 0 4970936 871 756 115 128 0 265 11 pmappl 232 16795 0 16780 29 28 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 638 0 36 18 0 18 18 0 8 0