panic: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 315 Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 520485 23618 0 0x9000000 0 0 syz-executor *266654 23618 0 0x9000000 0x4000000 1K syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff830e1479) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff83095269,ffffffff8306f733,13b,ffffffff83077fc2) at __assert+0x29 tun_clone_destroy(ffff8000011c0800) at tun_clone_destroy+0x38a sys/net/if_tun.c:315 if_clone_destroy(ffff8000326e38a0) at if_clone_destroy+0x1d7 sys/net/if.c:1384 ifioctl(ffff800001281230,80206979,ffff8000326e38a0,ffff8000371c42f0) at ifioctl+0x5c5 sys_ioctl(ffff8000371c42f0,ffff8000326e3a80,ffff8000326e39d0) at sys_ioctl+0x67c syscall(ffff8000326e3a80) at syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff8000326e3a80) at syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x83eb7b52760, 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 "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 315 ddb{1}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff830e1479) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff83095269,ffffffff8306f733,13b,ffffffff83077fc2) at __assert+0x29 tun_clone_destroy(ffff8000011c0800) at tun_clone_destroy+0x38a sys/net/if_tun.c:315 if_clone_destroy(ffff8000326e38a0) at if_clone_destroy+0x1d7 sys/net/if.c:1384 ifioctl(ffff800001281230,80206979,ffff8000326e38a0,ffff8000371c42f0) at ifioctl+0x5c5 sys_ioctl(ffff8000371c42f0,ffff8000326e3a80,ffff8000326e39d0) at sys_ioctl+0x67c syscall(ffff8000326e3a80) at syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff8000326e3a80) at syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x83eb7b52760, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000326e3650 rbx 0xffff800029b7cd87 rdx 0xffff800001220740 rcx 0xffff8000371c42f0 rax 0xffff800029b7bff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0xe5bcc5a9cd60c5f8 r11 0x14cf3d6db08bb05c r12 0xffff800029b7cb88 r13 0 r14 0 r15 0x1 rip 0xffffffff81a66ec5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff8000326e3640 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor) tid=266654 pid=23618 tcnt=2 stat=onproc flags process=9000000 proc=4000000 runpri=32, usrpri=50, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff8000371c4d10,0xffff8000371c5c50 process=0xffff8000371ad228 user=0xffff8000326de000, vmspace=0xfffffd8073aff1d0 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 57311 233661 6632 0 2 0x8000000 syz-executor 57311 93013 6632 0 2 0xc000000 syz-executor 23618 520485 9507 0 7 0x9000000 syz-executor *23618 266654 9507 0 7 0xd000000 syz-executor 19022 152766 94530 0 3 0x8000080 nanoslp syz-executor 19022 351102 94530 0 3 0xc000080 kqpoll syz-executor 19022 262904 94530 0 3 0xc000080 fsleep syz-executor 19022 477301 94530 0 3 0xc000080 fsleep syz-executor 26077 49427 73021 0 3 0x8000080 nanoslp syz-executor 26077 447336 73021 0 3 0xc000080 lockf syz-executor 26077 384090 73021 0 3 0xc000080 fsleep syz-executor 26077 332895 73021 0 3 0xc000080 fsleep syz-executor 55494 371133 86471 0 3 0x8000080 nanoslp syz-executor 55494 38013 86471 0 3 0xc000080 sbwait syz-executor 55494 129904 86471 0 3 0xc000080 fsleep syz-executor 86691 275592 45051 0 3 0x8000080 nanoslp syz-executor 86691 150948 45051 0 3 0xc000080 ttyopn syz-executor 86691 5365 45051 0 3 0xc000080 fsleep syz-executor 45051 204224 68874 0 3 0x8000082 nanoslp syz-executor 86471 21428 68874 0 3 0x8000082 nanoslp syz-executor 34849 375577 68874 0 3 0x8000082 nanoslp syz-executor 94530 276825 68874 0 3 0x8000082 nanoslp syz-executor 2926 116061 68874 0 3 0x8000082 nanoslp syz-executor 6632 477168 68874 0 3 0x8000082 nanoslp syz-executor 9507 344564 68874 0 3 0x8000082 nanoslp syz-executor 73021 120080 68874 0 3 0x8000082 nanoslp syz-executor 87226 489444 1 0 3 0x18100083 ttyin getty 76667 38011 0 0 3 0x14200 acct acct 15935 402298 0 0 3 0x14200 bored sosplice 68874 419466 82776 0 3 0x8000082 kqread syz-executor 82776 167451 37594 0 3 0x810008a sigsusp ksh 37594 518453 90429 0 3 0x18000098 kqread sshd-session 90429 389399 62057 0 3 0x18000092 kqread sshd-session 62057 204841 1 0 3 0x18000088 kqread sshd 29327 81013 11153 74 3 0x19100092 bpf pflogd 11153 99230 1 0 3 0x18000080 sbwait pflogd 69608 489076 24379 73 3 0x19100010 biowait syslogd 24379 146626 1 0 3 0x18100082 sbwait syslogd 79586 250411 1 0 3 0x18100080 kqread resolvd 36281 333990 70550 77 2 0x18100092 dhcpleased 38547 426274 70550 77 3 0x18100092 kqread dhcpleased 70550 314618 1 0 3 0x18000080 kqread dhcpleased 61777 439633 0 0 3 0x14200 bored smr 19846 80541 0 0 3 0x14200 pgzero zerothread 65520 189061 0 0 3 0x14200 aiodoned aiodoned 13607 372715 0 0 3 0x14200 syncer update 4890 205285 0 0 3 0x14200 cleaner cleaner 85217 493290 0 0 3 0x14200 reaper reaper 30250 56128 0 0 3 0x14200 pgdaemon pagedaemon 80418 282265 0 0 3 0x14200 bored viomb 22494 80669 0 0 3 0x40014200 acpi0 acpi0 89422 143274 0 0 3 0x40014200 idle1 32732 87753 0 0 3 0x14200 bored softnet3 90015 304762 0 0 3 0x14200 bored softnet2 52744 106199 0 0 3 0x14200 bored softnet1 74192 362760 0 0 3 0x14200 bored softnet0 55379 285255 0 0 3 0x14200 bored systqmp 65813 423555 0 0 3 0x14200 bored systq 91808 218175 0 0 3 0x14200 tmoslp softclockmp 50627 520143 0 0 3 0x40014200 tmoslp softclock 63886 13057 0 0 3 0x40014200 idle0 1 253699 0 0 3 0x8080082 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 23618 (syz-executor) thread 0xffff8000371c42f0 (266654) Process 69608 (syslogd) thread 0xffff8000ffffd960 (489076) ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10254 10271K 10903K 166960K 20676 0 pcb 19 22K 24K 166960K 1579 0 rtable 246 18K 18K 166960K 5603 0 pf 51 20K 28K 166960K 730 0 ifaddr 47 9K 10K 166960K 758 0 ifgroup 80 3K 3K 166960K 924 0 sysctl 4 1K 1K 166960K 10 0 counters 76 37K 38K 166960K 530 0 ioctlops 0 0K 4K 166960K 2716 0 iov 0 0K 24K 166960K 748 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1525 96K 97K 166960K 9671 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 9K 166960K 114 0 VM map 2 1K 1K 166960K 2 0 sem 12 0K 0K 166960K 497 0 dirhash 15 2K 3K 166960K 144 0 ACPI 1697 195K 286K 166960K 12548 0 file desc 18 65K 97K 166960K 7651 0 sigio 1 0K 0K 166960K 136 0 proc 70 91K 140K 166960K 5352 0 subproc 104 6K 7K 166960K 2108 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 853 0 in_multi 90 6K 7K 166960K 1951 0 ether_multi 1 0K 0K 166960K 72 0 mrt 1 0K 0K 166960K 26 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 253 1129K 1129K 166960K 253 0 exec 0 0K 1K 166960K 3637 0 pfkey data 0 0K 0K 166960K 8 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 304 103K 133K 166960K 66394 0 UVM aobj 30 4K 5K 166960K 33 0 pinsyscall 43 86K 110K 166960K 12752 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 1 0K 1K 166960K 361 0 NDP 18 0K 2K 166960K 570 0 temp 80 6824K 6960K 166960K 548811 0 kqueue 13 20K 32K 166960K 916 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 24 0 0 1 0 1 1 0 8 0 rtpcb 120 937 0 934 6 5 1 3 0 8 0 rtentry 112 1955 0 1853 6 2 4 4 0 8 0 unpcb 144 7386 0 7357 52 50 2 10 0 8 0 syncache 336 5 0 5 3 3 0 1 0 8 0 tcpcb 808 2658 0 2654 75 71 4 11 0 8 3 arp 120 361 0 342 1 0 1 1 0 8 0 inpcb 336 10606 0 10530 138 130 8 17 0 8 1 nd6 136 541 0 514 3 2 1 2 0 8 0 pkpcb 40 31 0 31 12 11 1 1 0 8 1 kcovpl 48 162 0 154 1 0 1 1 0 8 0 ppxss 1168 38 0 38 16 15 1 1 0 8 1 pfstscr 40 2 0 2 2 2 0 1 0 8 0 pffrag 232 41 0 35 2 1 1 1 0 482 0 pffrnode 88 38 0 32 2 1 1 1 0 8 0 pffrent 40 150 0 144 2 1 1 1 0 8 0 pfosfp 40 1429 0 1429 5 5 0 5 0 8 0 pfosfpen 112 1429 0 1429 21 21 0 21 0 8 0 pfrktable 1344 28 0 26 4 3 1 1 0 8 0 pfanchor 1288 7 0 3 2 1 1 1 0 8 0 pftag 88 10 0 10 3 3 0 1 0 8 0 pfstitem 24 86 0 82 1 0 1 1 0 8 0 pfstkey 128 92 0 88 2 0 2 2 0 8 0 pfstate 376 86 0 83 4 2 2 4 0 8 0 pfrule 1344 48 0 39 2 1 1 2 0 8 0 art_heap8 4096 3 0 0 3 0 3 3 0 8 0 art_heap4 256 7547 0 7144 51 25 26 31 0 8 0 art_table 32 7550 0 7144 4 0 4 4 0 8 0 art_node 16 1941 0 1851 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 1 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 495 0 485 1 0 1 1 0 8 0 shmpl 112 30 0 3 1 0 1 1 0 8 0 dirhash 1024 107 0 87 4 1 3 4 0 8 0 dino2pl 256 12264 0 10440 116 1 115 115 0 8 0 ffsino 272 12264 0 10440 124 1 123 123 0 8 0 nchpl 144 20812 0 20043 69 38 31 68 0 8 0 uvmvnodes 80 9941 0 0 203 0 203 203 0 8 0 vnodes 216 9941 0 0 553 0 553 553 0 8 0 namei 1024 101008 0 101008 13 12 1 2 0 8 1 percpumem 16 279 0 227 1 0 1 1 0 8 0 vcpupl 3904 62 0 3 8 0 8 8 0 8 0 vmpool 696 78 0 19 7 1 6 6 0 8 0 pfiaddrpl 120 7 0 6 4 3 1 1 0 8 0 kstatmem 264 490 0 454 3 0 3 3 0 8 0 scsiplug 72 15 0 15 9 9 0 1 0 8 0 scxspl 216 160673 0 160672 27 26 1 8 1 8 0 plimitpl 152 2128 0 2110 1 0 1 1 0 8 0 sigapl 424 7674 0 7622 11 4 7 9 0 8 0 futexpl 64 101198 0 101192 19 18 1 1 0 8 0 knotepl 120 1102 0 0 24 0 24 24 0 8 0 kqueuepl 216 2333 0 2321 27 26 1 6 0 8 0 pipepl 320 1957 0 1930 41 28 13 13 0 8 10 fdescpl 496 7630 0 7598 13 8 5 6 0 8 0 filepl 152 66530 0 66187 123 94 29 29 0 8 13 lockfpl 104 2840 0 2835 5 4 1 2 0 8 0 lockfspl 48 1025 0 1021 1 0 1 1 0 8 0 sessionpl 144 183 0 174 1 0 1 1 0 8 0 pgrppl 48 509 0 492 1 0 1 1 0 8 0 ucredpl 104 12217 0 12204 1 0 1 1 0 8 0 zombiepl 144 7624 0 7622 2 1 1 1 0 8 0 processpl 1160 7674 0 7622 7 2 5 6 0 8 0 procpl 648 17321 0 17257 16 9 7 9 0 8 0 srpgc 96 61 0 61 14 14 0 1 0 8 0 sosppl 168 33 0 33 14 13 1 1 0 8 1 sockpl 664 19159 0 19051 168 158 10 23 0 8 0 mcl64k 65536 8 0 0 1 0 1 1 0 8 0 mcl16k 16384 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 4 0 0 1 0 1 1 0 8 0 mcl9k 9216 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 17 0 0 3 0 3 3 0 8 0 mcl4k 4096 35 0 0 5 2 3 5 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 338 0 0 30 1 29 30 0 8 0 mtagpl 96 74 0 0 2 0 2 2 0 8 0 mbufpl 256 1307 0 0 65 0 65 65 0 8 0 bufpl 280 26545 0 16601 711 0 711 711 0 8 0 anonpl 24 1063796 0 1056774 166 93 73 86 0 185 11 amapchunkpl 152 217100 0 216404 88 53 35 47 0 158 8 amappl16 200 20582 0 20440 133 121 12 31 0 8 0 amappl15 192 46 0 46 1 1 0 1 0 8 0 amappl14 184 448 0 435 1 0 1 1 0 8 0 amappl13 176 14 0 14 3 3 0 1 0 8 0 amappl12 168 10727 0 10695 3 1 2 2 0 8 0 amappl11 160 88 0 74 1 0 1 1 0 8 0 amappl10 152 12 0 12 1 1 0 1 0 8 0 amappl9 144 139 0 138 2 1 1 1 0 8 0 amappl8 136 21 0 17 1 0 1 1 0 8 0 amappl7 128 426 0 413 1 0 1 1 0 8 0 amappl6 120 1723 0 1721 1 0 1 1 0 8 0 amappl5 112 761 0 749 1 0 1 1 0 8 0 amappl4 104 804 0 783 1 0 1 1 0 8 0 amappl3 96 43683 0 43538 4 0 4 4 0 8 0 amappl2 88 2827 0 2761 2 0 2 2 0 8 0 amappl1 80 39906 0 39317 18 4 14 15 0 8 0 amappl 88 64473 0 64256 7 1 6 6 0 92 0 dma32768 32768 2 0 2 2 2 0 1 0 8 0 dma16384 16384 4 0 4 2 2 0 1 0 8 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 3 0 2 1 0 1 1 0 8 0 dma256 256 9 0 9 3 3 0 1 0 8 0 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 8 0 8 3 3 0 1 0 8 0 dma32 32 10 0 10 3 3 0 1 0 8 0 dma16 16 20 0 19 1 0 1 1 0 8 0 aobjpl 72 32 0 3 1 0 1 1 0 8 0 uaddrrnd 24 7708 0 7617 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 7708 0 7617 1 0 1 1 0 8 0 vmmpekpl 168 65142 0 65077 5 1 4 4 0 8 0 vmmpepl 168 474434 0 472273 201 106 95 111 0 357 0 vmsppl 440 7707 0 7617 13 2 11 11 0 8 0 rwobjpl 56 131311 0 120204 170 12 158 160 0 8 0 pdppl 4096 15423 0 15293 354 224 130 137 0 8 0 pvpl 32 45396 0 0 362 1 361 361 0 265 0 pmappl 248 7707 0 7617 6 0 6 6 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 1011 0 494 15 0 15 15 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffffffff83415ff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __mp_lock(ffffffff835fbd28) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff835fbd28) at __mp_lock+0x192 sys/kern/kern_lock.c:144 intr_handler(ffff80002a1343d0,ffff80000006bc00) at intr_handler+0xe1 sys/arch/amd64/amd64/intr.c:553 Xintr_ioapic_edge23_untramp() at Xintr_ioapic_edge23_untramp+0x18f end of kernel end trace frame: 0x7cef45379b40, count: 9 ddb{0}> trace x86_ipi_db(ffffffff83415ff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __mp_lock(ffffffff835fbd28) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff835fbd28) at __mp_lock+0x192 sys/kern/kern_lock.c:144 intr_handler(ffff80002a1343d0,ffff80000006bc00) at intr_handler+0xe1 sys/arch/amd64/amd64/intr.c:553 Xintr_ioapic_edge23_untramp() at Xintr_ioapic_edge23_untramp+0x18f end of kernel end trace frame: 0x7cef45379b40, count: -6 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x25: addq $0x8,%rsp db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff830e1479) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff83095269,ffffffff8306f733,13b,ffffffff83077fc2) at __assert+0x29 tun_clone_destroy(ffff8000011c0800) at tun_clone_destroy+0x38a sys/net/if_tun.c:315 if_clone_destroy(ffff8000326e38a0) at if_clone_destroy+0x1d7 sys/net/if.c:1384 ifioctl(ffff800001281230,80206979,ffff8000326e38a0,ffff8000371c42f0) at ifioctl+0x5c5 sys_ioctl(ffff8000371c42f0,ffff8000326e3a80,ffff8000326e39d0) at sys_ioctl+0x67c syscall(ffff8000326e3a80) at syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff8000326e3a80) at syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x83eb7b52760, count: 6 ddb{1}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff830e1479) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff83095269,ffffffff8306f733,13b,ffffffff83077fc2) at __assert+0x29 tun_clone_destroy(ffff8000011c0800) at tun_clone_destroy+0x38a sys/net/if_tun.c:315 if_clone_destroy(ffff8000326e38a0) at if_clone_destroy+0x1d7 sys/net/if.c:1384 ifioctl(ffff800001281230,80206979,ffff8000326e38a0,ffff8000371c42f0) at ifioctl+0x5c5 sys_ioctl(ffff8000371c42f0,ffff8000326e3a80,ffff8000326e39d0) at sys_ioctl+0x67c syscall(ffff8000326e3a80) at syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff8000326e3a80) at syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x83eb7b52760, count: -9