panic: pool_cache_item_magic_check: mbufpl cpu free list modified: item addr 0xfffffd8068a75400+16 0x0!=0x88400ec187fdb227 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *157237 87117 0 0 0x4000000 1K syz-executor.0 394170 83508 0 0x2 0x4000000 0 syz-fuzzer db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 pool_cache_get(ffffffff82633bc0) at pool_cache_get+0x323 pool_cache_item_magic_check sys/kern/subr_pool.c:1789 [inline] pool_cache_get(ffffffff82633bc0) at pool_cache_get+0x323 sys/kern/subr_pool.c:1892 pool_get() at pool_get+0x91 sys/kern/subr_pool.c:572 m_gethdr(2,1) at m_gethdr+0x4c sys/kern/uipc_mbuf.c:283 tun_dev_write(ffff800000ac0800,ffff800021b719e8,d9) at tun_dev_write+0x96 spec_write(ffff800021b71830) at spec_write+0xd4 sys/kern/spec_vnops.c:310 VOP_WRITE(fffffd807cda21a8,ffff800021b719e8,11,fffffd807f7c6900) at VOP_WRITE+0xc6 sys/kern/vfs_vops.c:269 vn_write(fffffd8066b8c1e0,ffff800021b719e8,0) at vn_write+0x14f sys/kern/vfs_vnops.c:405 dofilewritev(ffff800020ab0780,f0,ffff800021b719e8,0,ffff800021b71ad0) at dofilewritev+0x1b7 sys/kern/sys_generic.c:364 sys_write(ffff800020ab0780,ffff800021b71a80,ffff800021b71ad0) at sys_write+0x83 sys/kern/sys_generic.c:284 syscall(ffff800021b71b50) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021b71b50) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,4,0,4,2,47d54acb800) at Xsyscall+0x128 end of kernel end trace frame: 0x47d79b7beb0, count: 2 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 pool_cache_item_magic_check: mbufpl cpu free list modified: item addr 0xfffffd8068a75400+16 0x0!=0x88400ec187fdb227 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 pool_cache_get(ffffffff82633bc0) at pool_cache_get+0x323 pool_cache_item_magic_check sys/kern/subr_pool.c:1789 [inline] pool_cache_get(ffffffff82633bc0) at pool_cache_get+0x323 sys/kern/subr_pool.c:1892 pool_get() at pool_get+0x91 sys/kern/subr_pool.c:572 m_gethdr(2,1) at m_gethdr+0x4c sys/kern/uipc_mbuf.c:283 tun_dev_write(ffff800000ac0800,ffff800021b719e8,d9) at tun_dev_write+0x96 spec_write(ffff800021b71830) at spec_write+0xd4 sys/kern/spec_vnops.c:310 VOP_WRITE(fffffd807cda21a8,ffff800021b719e8,11,fffffd807f7c6900) at VOP_WRITE+0xc6 sys/kern/vfs_vops.c:269 vn_write(fffffd8066b8c1e0,ffff800021b719e8,0) at vn_write+0x14f sys/kern/vfs_vnops.c:405 dofilewritev(ffff800020ab0780,f0,ffff800021b719e8,0,ffff800021b71ad0) at dofilewritev+0x1b7 sys/kern/sys_generic.c:364 sys_write(ffff800020ab0780,ffff800021b71a80,ffff800021b71ad0) at sys_write+0x83 sys/kern/sys_generic.c:284 syscall(ffff800021b71b50) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021b71b50) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,4,0,4,2,47d54acb800) at Xsyscall+0x128 end of kernel end trace frame: 0x47d79b7beb0, count: -13 ddb{1}> show registers rdi 0xffffffff81e07517 db_enter+0x17 rsi 0x39d3 __ALIGN_SIZE+0x29d3 rbp 0xffff800021b714d0 rbx 0xffff800021b71580 rdx 0x39d4 __ALIGN_SIZE+0x29d4 rcx 0xffff800021164000 rax 0xffff800021164000 r8 0xffffffff817fb7bf kprintf+0x16f r9 0x1 r10 0x25 r11 0xd45b5c0dd3c05cc6 r12 0x3000000008 r13 0xffff800021b714e0 r14 0x100 r15 0x1 rip 0xffffffff81e07518 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021b714c0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=157237 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ab09f8,0xffffffff826286b0 process=0xffff800020adce00 user=0xffff800021b6c000, vmspace=0xfffffd807f00a730 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 87117 238760 16793 0 2 0 syz-executor.0 *87117 157237 16793 0 7 0x4000000 syz-executor.0 89978 60014 0 0 3 0x14200 acct acct 33504 443451 0 0 3 0x14200 bored sosplice 16793 350222 83508 0 3 0x82 nanosleep syz-executor.0 65795 386509 83508 0 3 0x2 biowait syz-executor.1 83508 188978 86805 0 3 0x82 nanosleep syz-fuzzer 83508 460012 86805 0 3 0x4000082 nanosleep syz-fuzzer 83508 236460 86805 0 3 0x4000082 thrsleep syz-fuzzer 83508 135842 86805 0 3 0x4000082 thrsleep syz-fuzzer 83508 109598 86805 0 3 0x4000082 thrsleep syz-fuzzer 83508 294781 86805 0 3 0x4000082 thrsleep syz-fuzzer 83508 100452 86805 0 3 0x4000082 thrsleep syz-fuzzer 83508 389604 86805 0 3 0x4000082 thrsleep syz-fuzzer 83508 394170 86805 0 7 0x4000002 syz-fuzzer 83508 470782 86805 0 3 0x4000082 thrsleep syz-fuzzer 86805 514975 75914 0 3 0x10008a pause ksh 75914 460212 83090 0 3 0x92 select sshd 65260 233893 1 0 3 0x100083 ttyin getty 83090 361069 1 0 3 0x80 select sshd 18596 22234 28480 74 3 0x100092 bpf pflogd 28480 405605 1 0 3 0x80 netio pflogd 84937 108028 63078 73 3 0x100090 kqread syslogd 63078 138102 1 0 3 0x100082 netio syslogd 73225 485816 1 77 3 0x100090 poll dhclient 52136 406500 1 0 3 0x80 poll dhclient 4784 460895 0 0 2 0x14200 zerothread 74107 366370 0 0 3 0x14200 aiodoned aiodoned 72588 500406 0 0 3 0x14200 syncer update 98541 257362 0 0 3 0x14200 cleaner cleaner 92890 401288 0 0 3 0x14200 reaper reaper 68072 412418 0 0 3 0x14200 pgdaemon pagedaemon 35479 13882 0 0 3 0x14200 bored crynlk 97568 86479 0 0 3 0x14200 bored crypto 6810 205164 0 0 3 0x40014200 acpi0 acpi0 94899 201005 0 0 3 0x40014200 idle1 30605 501099 0 0 3 0x14200 bored softnet 30387 22739 0 0 3 0x14200 bored systqmp 85570 154799 0 0 3 0x14200 bored systq 13152 263061 0 0 3 0x40014200 bored softclock 46372 491282 0 0 3 0x40014200 idle0 77118 6168 0 0 3 0x14200 bored smr 1 82025 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 87117 (syz-executor.0) thread 0xffff800020ab0780 (157237) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff826408b0) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 vn_write+0x42 sys/kern/vfs_vnops.c:390 #2 dofilewritev+0x1b7 sys/kern/sys_generic.c:364 #3 sys_write+0x83 sys/kern/sys_generic.c:284 #4 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] #4 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 #5 Xsyscall+0x128 Process 65795 (syz-executor.1) thread 0xffff800020ab0ee8 (386509) exclusive rrwlock inode r = 0 (0xfffffd807cf03928) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x447 sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 VOP_LOCK+0xf0 sys/kern/vfs_vops.c:615 #4 vn_lock+0x81 sys/kern/vfs_vnops.c:562 #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+0x14b4 sys/ufs/ufs/ufs_lookup.c:487 #9 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:91 #10 vfs_lookup+0x7a6 sys/kern/vfs_lookup.c:568 #11 namei+0x63c sys/kern/vfs_lookup.c:249 #12 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1785 #13 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] #13 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806ac752b8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x447 sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 VOP_LOCK+0xf0 sys/kern/vfs_vops.c:615 #4 vn_lock+0x81 sys/kern/vfs_vnops.c:562 #5 vfs_lookup+0xe6 sys/kern/vfs_lookup.c:419 #6 namei+0x63c sys/kern/vfs_lookup.c:249 #7 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1785 #8 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] #8 syscall+0x4a4 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 9540 6540K 7050K 78643K 11216 0 0 pcb 13 10K 12K 78643K 96 0 0 rtable 95 11K 12K 78643K 396 0 0 ifaddr 64 13K 14K 78643K 121 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1489 0 0 iov 0 0K 16K 78643K 58 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1216 76K 77K 78643K 1442 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 5 0 0 VM map 2 1K 1K 78643K 5 0 0 sem 12 1K 1K 78643K 16 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 25K 78643K 349 0 0 sigio 0 0K 0K 78643K 2 0 0 proc 61 63K 83K 78643K 530 0 0 subproc 32 2K 2K 78643K 51 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 22 0 0 in_multi 19 1K 2K 78643K 66 0 0 ether_multi 1 0K 0K 78643K 4 0 0 mrt 0 0K 0K 78643K 2 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 286 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 110 22K 24K 78643K 2171 0 0 UVM aobj 10 2K 2K 78643K 15 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 51 0 0 NDP 14 0K 0K 78643K 33 0 0 temp 185 3552K 3623K 78643K 13852 0 0 kqueue 0 0K 0K 78643K 8 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 9 0 4 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 29 0 27 1 0 1 1 0 8 0 rtentry 112 76 0 40 2 0 2 2 0 8 0 unpcb 120 208 0 198 2 0 2 2 0 8 1 syncache 264 5 0 5 2 2 0 1 0 8 0 tcpqe 32 6347 0 6347 3 3 0 2 0 8 0 tcpcb 544 107 0 102 1 0 1 1 0 8 0 inpcb 280 1060 0 1052 14 4 10 13 0 8 8 nd6 48 7 0 6 1 0 1 1 0 8 0 ppxss 1128 10 0 10 3 2 1 1 0 8 1 pffrag 232 4 0 4 2 2 0 1 0 482 0 pffrnode 88 4 0 4 2 2 0 1 0 8 0 pffrent 40 8 0 8 2 2 0 1 0 8 0 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 33 0 13 1 0 1 1 0 8 0 pfstkey 112 33 0 13 1 0 1 1 0 8 0 pfstate 328 33 0 13 2 0 2 2 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 296 0 125 14 1 13 14 0 8 0 art_table 32 298 0 125 2 0 2 2 0 8 0 art_node 16 65 0 32 1 0 1 1 0 8 0 sysvmsgpl 40 90 0 50 1 0 1 1 0 8 0 semupl 112 4 0 4 1 1 0 1 0 8 0 semapl 112 14 0 4 1 0 1 1 0 8 0 shmpl 112 13 0 5 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1919 0 516 46 0 46 46 0 8 0 ffsino 272 1919 0 516 96 2 94 95 0 8 0 nchpl 144 2673 0 2212 61 41 20 61 0 8 0 uvmvnodes 72 2116 0 0 39 0 39 39 0 8 0 vnodes 208 2116 0 0 112 0 112 112 0 8 0 namei 1024 7581 0 7581 3 2 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vmpool 552 3 0 3 2 1 1 1 0 8 1 scxspl 192 7407 0 7406 12 11 1 7 0 8 0 plimitpl 152 42 0 34 1 0 1 1 0 8 0 sigapl 432 546 0 531 3 1 2 3 0 8 0 futexpl 56 7064 0 7064 1 0 1 1 0 8 1 knotepl 112 117 0 98 1 0 1 1 0 8 0 kqueuepl 104 81 0 79 1 0 1 1 0 8 0 pipepl 112 498 0 479 5 3 2 2 0 8 1 fdescpl 488 547 0 531 3 0 3 3 0 8 0 filepl 152 4013 0 3910 16 4 12 13 0 8 8 lockfpl 104 110 0 109 1 0 1 1 0 8 0 lockfspl 48 37 0 36 1 0 1 1 0 8 0 sessionpl 112 19 0 8 1 0 1 1 0 8 0 pgrppl 48 23 0 12 1 0 1 1 0 8 0 ucredpl 96 315 0 306 1 0 1 1 0 8 0 zombiepl 144 531 0 531 4 3 1 1 0 8 1 processpl 896 564 0 531 4 0 4 4 0 8 0 procpl 632 1336 0 1293 6 1 5 5 0 8 1 srpgc 64 5 0 5 2 1 1 1 0 8 1 sosppl 128 17 0 17 2 1 1 1 0 8 1 sockpl 384 1307 0 1287 25 14 11 22 0 8 8 mcl64k 65536 256 0 0 32 3 29 32 0 8 1 mcl16k 16384 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 3 0 0 1 0 1 1 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 6 0 0 1 0 1 1 0 8 0 mcl2k2 2112 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 210 0 0 24 0 24 24 0 8 0 mtagpl 80 20 0 0 1 0 1 1 0 8 0 mbufpl 256 367 0 0 21 0 21 21 0 8 0 bufpl 256 6914 0 1316 350 0 350 350 0 8 0 anonpl 16 75454 0 59077 92 14 78 78 0 124 11 amapchunkpl 152 3402 0 3266 15 8 7 13 0 158 0 amappl16 192 2955 0 2052 62 9 53 54 0 8 7 amappl15 184 8 0 7 1 0 1 1 0 8 0 amappl14 176 69 0 67 2 1 1 1 0 8 0 amappl13 168 2 0 2 2 2 0 1 0 8 0 amappl12 160 124 0 121 2 1 1 1 0 8 0 amappl11 152 60 0 45 1 0 1 1 0 8 0 amappl10 144 176 0 168 1 0 1 1 0 8 0 amappl9 136 632 0 626 1 0 1 1 0 8 0 amappl8 128 194 0 167 1 0 1 1 0 8 0 amappl7 120 195 0 188 1 0 1 1 0 8 0 amappl6 112 77 0 65 1 0 1 1 0 8 0 amappl5 104 259 0 244 1 0 1 1 0 8 0 amappl4 96 807 0 777 1 0 1 1 0 8 0 amappl3 88 147 0 142 1 0 1 1 0 8 0 amappl2 80 3391 0 3320 4 2 2 3 0 8 0 amappl1 72 21922 0 21486 25 15 10 20 0 8 0 amappl 80 1618 0 1574 2 0 2 2 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 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 17 0 17 1 1 0 1 0 8 0 aobjpl 64 14 0 5 1 0 1 1 0 8 0 uaddrrnd 24 550 0 531 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 550 0 531 1 0 1 1 0 8 0 vmmpekpl 168 8639 0 8600 2 0 2 2 0 8 0 vmmpepl 168 74591 0 72548 156 51 105 124 0 357 12 vmsppl 368 546 0 531 2 0 2 2 0 8 0 pdppl 4096 1107 0 1068 7 1 6 6 0 8 1 pvpl 32 224349 0 204767 222 35 187 187 0 265 27 pmappl 232 549 0 534 3 1 2 2 0 8 1 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 562 0 12 16 0 16 16 0 8 0