panic: kernel diagnostic assertion "uvn->u_obj.uo_refs == 0" failed: file "/syzkaller/managers/setuid/kernel/sys/uvm/uvm_vnode.c", line 234 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 61073 84730 32767 0x10 0x4000000 1K syz-executor.1 396212 6129 32767 0x10 0 0 syz-executor.0 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff8259d60a) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff826137ba,ffffffff82633e04,ea,ffffffff8262c70e) at __assert+0x25 sys/kern/subr_prf.c:161 uvn_attach(fffffd807952a520,6) at uvn_attach+0x444 sys/uvm/uvm_vnode.c:234 uvm_mmapfile(fffffd8066994748,ffff80002131e5d8,10000,2,6,11,a40240698b1bfe50,fffffd8066994748,0,11) at uvm_mmapfile+0x194 sys/uvm/uvm_mmap.c:1029 sys_mmap(ffff8000fffeca88,ffff80002131e680,ffff80002131e750) at sys_mmap+0xb4a sys/uvm/uvm_mmap.c:395 sys_pad_mmap(ffff8000fffeca88,ffff80002131e708,ffff80002131e750) at sys_pad_mmap+0x68 sys/uvm/uvm_mmap.c:470 syscall(ffff80002131e7d0) at syscall+0x435 mi_syscall sys/sys/syscall_mi.h:101 [inline] syscall(ffff80002131e7d0) at syscall+0x435 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x593223724c0, count: 6 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 *cpu1: kernel diagnostic assertion "uvn->u_obj.uo_refs == 0" failed: file "/syzkaller/managers/setuid/kernel/sys/uvm/uvm_vnode.c", line 234 ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff8259d60a) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff826137ba,ffffffff82633e04,ea,ffffffff8262c70e) at __assert+0x25 sys/kern/subr_prf.c:161 uvn_attach(fffffd807952a520,6) at uvn_attach+0x444 sys/uvm/uvm_vnode.c:234 uvm_mmapfile(fffffd8066994748,ffff80002131e5d8,10000,2,6,11,a40240698b1bfe50,fffffd8066994748,0,11) at uvm_mmapfile+0x194 sys/uvm/uvm_mmap.c:1029 sys_mmap(ffff8000fffeca88,ffff80002131e680,ffff80002131e750) at sys_mmap+0xb4a sys/uvm/uvm_mmap.c:395 sys_pad_mmap(ffff8000fffeca88,ffff80002131e708,ffff80002131e750) at sys_pad_mmap+0x68 sys/uvm/uvm_mmap.c:470 syscall(ffff80002131e7d0) at syscall+0x435 mi_syscall sys/sys/syscall_mi.h:101 [inline] syscall(ffff80002131e7d0) at syscall+0x435 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x593223724c0, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff80002131e270 rbx 0xffff800020dd9bb7 rdx 0 rcx 0 rax 0xffff8000fffeca88 r8 0x101010101010101 r9 0x8080808080808080 r10 0xccbea394915680a6 r11 0xd787c5de585bed23 r12 0xffff800020dd99b8 r13 0 r14 0 r15 0x1 rip 0xffffffff819f39f8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002131e260 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=61073 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=83, nice=20 forw=0xffffffffffffffff, list=0xffff8000fffef7a0,0xffff8000fffec2b8 process=0xffff8000fffeb620 user=0xffff800021319000, vmspace=0xfffffd8066994748 estcpu=36, cpticks=3, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 85284 373752 81572 32767 2 0x10 syz-executor.2 84730 109286 98061 32767 2 0x10 syz-executor.1 *84730 61073 98061 32767 7 0x4000010 syz-executor.1 84730 370449 98061 32767 2 0x4000090 syz-executor.1 84730 350565 98061 32767 3 0x4000090 fsleep syz-executor.1 84935 441917 62551 32767 2 0x10 syz-executor.7 84935 200859 62551 32767 3 0x4000090 fsleep syz-executor.7 47316 314511 46898 32767 2 0x10 syz-executor.6 47316 85895 46898 32767 3 0x4000090 fsleep syz-executor.6 6129 396212 52214 32767 7 0x10 syz-executor.0 6129 403985 52214 32767 3 0x4000090 fsleep syz-executor.0 6129 246081 52214 32767 2 0x4000010 syz-executor.0 69422 506500 97228 32767 2 0x10 syz-executor.4 69382 259360 5943 32767 2 0x10 syz-executor.3 69382 256698 5943 32767 3 0x4000090 fifor syz-executor.3 69382 467868 5943 32767 2 0x4000010 syz-executor.3 52214 125133 92996 32767 3 0x90 nanoslp syz-executor.0 92996 178538 42588 0 3 0x82 wait syz-executor.0 97228 277875 91322 32767 3 0x90 nanoslp syz-executor.4 91322 395965 42588 0 3 0x82 wait syz-executor.4 98061 367560 57313 32767 3 0x90 nanoslp syz-executor.1 57313 156859 42588 0 3 0x82 wait syz-executor.1 44057 269908 0 0 3 0x14200 bored sosplice 62551 504978 75586 32767 3 0x90 nanoslp syz-executor.7 46898 319777 73683 32767 3 0x90 nanoslp syz-executor.6 75586 504911 42588 0 3 0x82 wait syz-executor.7 73683 37802 42588 0 3 0x82 wait syz-executor.6 27967 485778 42588 0 3 0x82 wait syz-executor.5 5943 310525 47386 32767 3 0x90 nanoslp syz-executor.3 81572 513436 27782 32767 3 0x90 nanoslp syz-executor.2 47386 513718 42588 0 3 0x82 wait syz-executor.3 27782 225455 42588 0 3 0x82 wait syz-executor.2 42588 316251 81484 0 3 0x82 thrsleep syz-fuzzer 42588 236619 81484 0 3 0x4000082 nanoslp syz-fuzzer 42588 522288 81484 0 3 0x4000082 thrsleep syz-fuzzer 42588 61984 81484 0 3 0x4000082 thrsleep syz-fuzzer 42588 24614 81484 0 3 0x4000082 thrsleep syz-fuzzer 42588 102548 81484 0 3 0x4000082 thrsleep syz-fuzzer 42588 409633 81484 0 3 0x4000082 nanoslp syz-fuzzer 42588 303083 81484 0 3 0x4000082 kqread syz-fuzzer 42588 404869 81484 0 3 0x4000082 thrsleep syz-fuzzer 81484 278006 71986 0 3 0x10008a sigsusp ksh 71986 165436 7878 0 3 0x9a kqread sshd 34731 252065 1 0 3 0x100083 ttyin getty 7878 375954 1 0 3 0x88 kqread sshd 26469 123743 98467 73 3 0x1100090 kqread syslogd 98467 294195 1 0 3 0x100082 netio syslogd 56676 419806 1 0 3 0x100080 kqread resolvd 70394 173793 27024 77 3 0x100092 kqread dhcpleased 59271 390509 27024 77 3 0x100092 kqread dhcpleased 27024 19585 1 0 3 0x80 kqread dhcpleased 96676 12199 0 0 3 0x14200 bored smr 68997 284886 0 0 2 0x14200 zerothread 63220 496674 0 0 3 0x14200 aiodoned aiodoned 46839 499436 0 0 3 0x14200 syncer update 97902 266228 0 0 3 0x14200 cleaner cleaner 40268 165807 0 0 3 0x14200 reaper reaper 60730 516003 0 0 3 0x14200 pgdaemon pagedaemon 36716 34277 0 0 3 0x14200 bored viomb 86869 79693 0 0 3 0x40014200 acpi0 acpi0 87477 29746 0 0 3 0x40014200 idle1 24746 300821 0 0 3 0x14200 bored softnet 2660 333886 0 0 3 0x14200 bored softnet 26449 443478 0 0 3 0x14200 bored softnet 63712 237071 0 0 3 0x14200 bored softnet 28711 432060 0 0 3 0x14200 bored systqmp 43498 222614 0 0 3 0x14200 bored systq 97022 159583 0 0 3 0x40014200 bored softclock 25687 413242 0 0 3 0x40014200 idle0 1 69878 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 84730 (syz-executor.1) thread 0xffff8000fffeca88 (61073) exclusive kernel_lock &kernel_lock r = 1 (0xffffffff82b6f880) #0 witness_lock+0x44d #1 syscall+0x41d mi_syscall sys/sys/syscall_mi.h:100 [inline] #1 syscall+0x41d sys/arch/amd64/amd64/trap.c:585 #2 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10193 6410K 6419K 78643K 11296 0 pcb 13 12K 14K 78643K 17 0 rtable 242 6K 7K 78643K 833 0 ifaddr 81 16K 16K 78643K 110 0 sysctl 3 1K 1K 78643K 3 0 counters 56 35K 35K 78643K 64 0 ioctlops 0 0K 2K 78643K 50 0 iov 0 0K 28K 78643K 887 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 5 0 vnodes 1272 79K 79K 78643K 1955 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 65 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 1144 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 25 93K 113K 78643K 4526 0 sigio 0 0K 0K 78643K 95 0 proc 56 78K 115K 78643K 937 0 subproc 104 6K 6K 78643K 156 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 303 0 in_multi 99 6K 6K 78643K 197 0 ether_multi 1 0K 0K 78643K 12 0 mrt 1 0K 0K 78643K 2 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 157 705K 705K 78643K 157 0 exec 0 0K 2K 78643K 1287 0 tdb 3 0K 0K 78643K 3 0 pagedep 1 8K 8K 78643K 1 0 inodedep 1 32K 32K 78643K 1 0 newblk 1 0K 0K 78643K 1 0 VM swap 7 26K 26K 78643K 7 0 UVM amap 274 99K 100K 78643K 28976 0 UVM aobj 131 4K 4K 78643K 136 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 123 0 NDP 11 0K 2K 78643K 39 0 temp 124 4722K 4850K 78643K 13551 0 kqueue 12 18K 25K 78643K 347 0 SYN cache 2 16K 16K 78643K 2 0 ddb{1}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 22 0 0 1 0 1 1 0 8 0 rtpcb 120 578 0 575 5 4 1 3 0 8 0 rtentry 112 161 0 47 4 0 4 4 0 8 0 unpcb 144 4732 0 4717 62 61 1 8 0 8 0 syncache 296 42 0 42 10 9 1 1 0 8 1 tcpqe 32 63 0 63 8 8 0 1 0 8 0 tcpcb 736 1914 0 1894 74 66 8 11 0 8 6 arp 120 27 0 8 1 0 1 1 0 8 0 ipq 40 4 0 4 2 2 0 1 0 8 0 ipqe 40 9 0 9 2 2 0 1 0 8 0 inpcb 320 7757 0 7739 71 64 7 12 0 8 4 nd6 48 41 0 14 1 0 1 1 0 8 0 kcovpl 48 12 0 4 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 651 0 180 31 1 30 30 0 8 0 art_table 32 652 0 180 4 0 4 4 0 8 0 art_node 16 160 0 56 1 0 1 1 0 8 0 sysvmsgpl 40 6 0 1 1 0 1 1 0 8 0 semapl 112 1142 0 1132 1 0 1 1 0 8 0 shmpl 112 133 0 5 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 7422 0 5981 91 0 91 91 0 8 0 ffsino 272 7422 0 5981 97 0 97 97 0 8 0 nchpl 144 15019 0 13377 63 0 63 63 0 8 0 uvmvnodes 80 5926 0 0 121 0 121 121 0 8 0 vnodes 216 5926 0 0 330 0 330 330 0 8 0 namei 1024 51539 0 51539 4 3 1 2 0 8 1 percpumem 16 44 0 4 1 0 1 1 0 8 0 kstatmem 264 30 0 8 2 0 2 2 0 8 0 scxspl 216 53121 0 53121 21 19 2 7 0 8 2 plimitpl 152 1047 0 1025 3 2 1 2 0 8 0 sigapl 424 4797 0 4743 7 0 7 7 0 8 0 futexpl 64 41389 0 41385 5 4 1 1 0 8 0 knotepl 120 668 0 0 17 0 17 17 0 8 0 kqueuepl 216 1400 0 1391 29 24 5 5 0 8 4 pipepl 320 1129 0 1101 32 29 3 8 0 8 0 fdescpl 496 4779 0 4743 7 2 5 6 0 8 0 filepl 152 39893 0 39650 69 55 14 19 0 8 4 lockfpl 104 734 0 731 1 0 1 1 0 8 0 lockfspl 48 286 0 283 1 0 1 1 0 8 0 sessionpl 144 27 0 11 1 0 1 1 0 8 0 pgrppl 48 142 0 126 1 0 1 1 0 8 0 ucredpl 104 4456 0 4438 1 0 1 1 0 8 0 zombiepl 144 4744 0 4743 1 0 1 1 0 8 0 processpl 1064 4797 0 4743 4 0 4 4 0 8 0 procpl 672 13743 0 13672 15 8 7 8 0 8 1 sosppl 168 51 0 51 11 11 0 1 0 8 0 sockpl 488 13259 0 13224 304 292 12 29 0 8 7 mcl64k 65536 18 0 0 3 0 3 3 0 8 0 mcl16k 16384 17 0 0 3 0 3 3 0 8 0 mcl12k 12288 30 0 0 2 0 2 2 0 8 0 mcl9k 9216 16 0 0 2 0 2 2 0 8 0 mcl8k 8192 17 0 0 3 0 3 3 0 8 0 mcl4k 4096 54 0 0 6 3 3 5 0 8 0 mcl2k2 2112 6 0 0 1 0 1 1 0 8 0 mcl2k 2048 205 0 0 18 0 18 18 0 8 1 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 958 0 0 43 0 43 43 0 8 0 bufpl 288 12006 0 5679 453 0 453 453 0 8 0 anonpl 24 1051274 0 1038250 165 62 103 126 0 186 0 amapchunkpl 152 87615 0 86845 61 30 31 42 0 158 0 amappl16 200 17493 0 17089 103 77 26 35 0 8 4 amappl15 192 1081 0 1077 1 0 1 1 0 8 0 amappl14 184 1366 0 1358 2 1 1 1 0 8 0 amappl13 176 1080 0 1074 1 0 1 1 0 8 0 amappl12 168 316 0 309 1 0 1 1 0 8 0 amappl11 160 88 0 73 1 0 1 1 0 8 0 amappl10 152 595 0 589 1 0 1 1 0 8 0 amappl9 144 1093 0 1090 1 0 1 1 0 8 0 amappl8 136 839 0 762 3 0 3 3 0 8 0 amappl7 128 268 0 255 1 0 1 1 0 8 0 amappl6 120 839 0 818 2 1 1 2 0 8 0 amappl5 112 3531 0 3511 1 0 1 1 0 8 0 amappl4 104 1487 0 1456 3 1 2 3 0 8 0 amappl3 96 15448 0 15388 2 0 2 2 0 8 0 amappl2 88 6222 0 6147 3 1 2 3 0 8 0 amappl1 80 116529 0 115812 21 5 16 19 0 8 0 amappl 88 28266 0 28093 6 1 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 135 0 5 3 0 3 3 0 8 0 uaddrrnd 24 4779 0 4743 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 4779 0 4743 1 0 1 1 0 8 0 vmmpekpl 168 41738 0 41685 3 0 3 3 0 8 0 vmmpepl 168 473374 0 470556 221 89 132 143 0 357 9 vmsppl 368 4778 0 4743 4 0 4 4 0 8 0 rwobjpl 56 127470 0 120008 113 6 107 110 0 8 0 pdppl 4096 9565 0 9486 197 116 81 89 0 8 2 pvpl 32 2103807 0 2085342 410 228 182 266 0 265 9 pmappl 248 4778 0 4743 4 1 3 3 0 8 0 extentpl 40 58 0 38 1 0 1 1 0 8 0 phpool 112 1034 0 191 25 0 25 25 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffffffff829ceff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x28 kd_curproc sys/dev/kcov.c:577 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x28 sys/dev/kcov.c:148 __mp_lock(ffffffff82b6f678) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82b6f678) at __mp_lock+0x133 sys/kern/kern_lock.c:147 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:88 Xsoftclock() at Xsoftclock+0x1f end of kernel end trace frame: 0x7f7fffffaec0, count: 8 ddb{0}> trace x86_ipi_db(ffffffff829ceff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x28 kd_curproc sys/dev/kcov.c:577 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x28 sys/dev/kcov.c:148 __mp_lock(ffffffff82b6f678) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82b6f678) at __mp_lock+0x133 sys/kern/kern_lock.c:147 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:88 Xsoftclock() at Xsoftclock+0x1f end of kernel end trace frame: 0x7f7fffffaec0, count: -7 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x18: addq $0x8,%rsp db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff8259d60a) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff826137ba,ffffffff82633e04,ea,ffffffff8262c70e) at __assert+0x25 sys/kern/subr_prf.c:161 uvn_attach(fffffd807952a520,6) at uvn_attach+0x444 sys/uvm/uvm_vnode.c:234 uvm_mmapfile(fffffd8066994748,ffff80002131e5d8,10000,2,6,11,a40240698b1bfe50,fffffd8066994748,0,11) at uvm_mmapfile+0x194 sys/uvm/uvm_mmap.c:1029 sys_mmap(ffff8000fffeca88,ffff80002131e680,ffff80002131e750) at sys_mmap+0xb4a sys/uvm/uvm_mmap.c:395 sys_pad_mmap(ffff8000fffeca88,ffff80002131e708,ffff80002131e750) at sys_pad_mmap+0x68 sys/uvm/uvm_mmap.c:470 syscall(ffff80002131e7d0) at syscall+0x435 mi_syscall sys/sys/syscall_mi.h:101 [inline] syscall(ffff80002131e7d0) at syscall+0x435 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x593223724c0, count: 6 ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff8259d60a) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff826137ba,ffffffff82633e04,ea,ffffffff8262c70e) at __assert+0x25 sys/kern/subr_prf.c:161 uvn_attach(fffffd807952a520,6) at uvn_attach+0x444 sys/uvm/uvm_vnode.c:234 uvm_mmapfile(fffffd8066994748,ffff80002131e5d8,10000,2,6,11,a40240698b1bfe50,fffffd8066994748,0,11) at uvm_mmapfile+0x194 sys/uvm/uvm_mmap.c:1029 sys_mmap(ffff8000fffeca88,ffff80002131e680,ffff80002131e750) at sys_mmap+0xb4a sys/uvm/uvm_mmap.c:395 sys_pad_mmap(ffff8000fffeca88,ffff80002131e708,ffff80002131e750) at sys_pad_mmap+0x68 sys/uvm/uvm_mmap.c:470 syscall(ffff80002131e7d0) at syscall+0x435 mi_syscall sys/sys/syscall_mi.h:101 [inline] syscall(ffff80002131e7d0) at syscall+0x435 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x593223724c0, count: -9