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+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *190021 78715 0 0 0x4000000 0K syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82751deb) at panic+0x177 sys/kern/subr_prf.c:198 __assert(ffffffff827cd2be,ffffffff82818b32,13b,ffffffff827e01fc) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000d64000) at tun_clone_destroy+0x278 sys/net/if_tun.c:315 if_clone_destroy(ffff80002473f660) at if_clone_destroy+0x132 sys/net/if.c:1247 ifioctl(fffffd806d84b3e8,80206979,ffff80002473f660,ffff8000212cdb58) at ifioctl+0x3b4 sys/net/if.c:1924 sys_ioctl(ffff8000212cdb58,ffff80002473f778,ffff80002473f7c0) at sys_ioctl+0x4a2 syscall(ffff80002473f840) at syscall+0x606 mi_syscall sys/sys/syscall_mi.h:110 [inline] syscall(ffff80002473f840) at syscall+0x606 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4d19d328f40, 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{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic *cpu0: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 315 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82751deb) at panic+0x177 sys/kern/subr_prf.c:198 __assert(ffffffff827cd2be,ffffffff82818b32,13b,ffffffff827e01fc) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000d64000) at tun_clone_destroy+0x278 sys/net/if_tun.c:315 if_clone_destroy(ffff80002473f660) at if_clone_destroy+0x132 sys/net/if.c:1247 ifioctl(fffffd806d84b3e8,80206979,ffff80002473f660,ffff8000212cdb58) at ifioctl+0x3b4 sys/net/if.c:1924 sys_ioctl(ffff8000212cdb58,ffff80002473f778,ffff80002473f7c0) at sys_ioctl+0x4a2 syscall(ffff80002473f840) at syscall+0x606 mi_syscall sys/sys/syscall_mi.h:110 [inline] syscall(ffff80002473f840) at syscall+0x606 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4d19d328f40, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002473f410 rbx 0xffffffff82b25b8f cpu_info_full_primary+0x2b8f rdx 0xffff800000ee1a40 rcx 0 rax 0xffff8000212cdb58 r8 0 r9 0x8080808080808080 r10 0x7b070b26257d6a96 r11 0x4e9d62883a87b95e r12 0xffffffff82b25990 cpu_info_full_primary+0x2990 r13 0 r14 0 r15 0x1 rip 0xffffffff81b420b8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002473f400 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=190021 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000212cd5e8,0xffff8000212cc2f0 process=0xffff800021284448 user=0xffff80002473a000, vmspace=0xfffffd806b9458b0 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 11414 219900 46481 0 2 0 syz-executor.5 11414 397819 46481 0 3 0x4000080 fsleep syz-executor.5 78715 419739 73672 0 2 0 syz-executor.1 *78715 190021 73672 0 7 0x4000000 syz-executor.1 32466 80593 14324 0 2 0 syz-executor.7 32466 260297 14324 0 3 0x4000080 piperd syz-executor.7 32466 324220 14324 0 3 0x4000080 piperd syz-executor.7 53726 196253 39322 0 2 0 syz-executor.2 53726 424304 39322 0 3 0x4000080 fsleep syz-executor.2 53726 41631 39322 0 2 0x4000000 syz-executor.2 82158 347409 36432 0 2 0x2 syz-executor.6 39322 447005 36432 0 2 0x482 syz-executor.2 46481 457472 36432 0 2 0x482 syz-executor.5 43405 166519 36432 0 2 0x482 syz-executor.3 19942 476285 36432 0 3 0x82 piperd syz-executor.4 14324 392842 36432 0 2 0x482 syz-executor.7 61999 66816 0 0 3 0x14280 nfsidl nfsio 81836 86831 0 0 3 0x14280 nfsidl nfsio 83585 356923 0 0 3 0x14280 nfsidl nfsio 35591 398151 0 0 3 0x14280 nfsidl nfsio 39932 362447 0 0 3 0x14280 nfsidl nfsio 43606 204988 0 0 3 0x14280 nfsidl nfsio 5768 483682 0 0 3 0x14280 nfsidl nfsio 98069 489531 0 0 3 0x14280 nfsidl nfsio 17099 239434 0 0 3 0x14280 nfsidl nfsio 59921 161978 0 0 3 0x14280 nfsidl nfsio 45700 327644 0 0 3 0x14280 nfsidl nfsio 81780 137878 0 0 3 0x14280 nfsidl nfsio 38829 91620 0 0 3 0x14280 nfsidl nfsio 4299 265681 0 0 3 0x14280 nfsidl nfsio 32985 315379 0 0 3 0x14280 nfsidl nfsio 11433 462871 0 0 3 0x14280 nfsidl nfsio 56512 248340 0 0 3 0x14280 nfsidl nfsio 72762 102871 0 0 3 0x14280 nfsidl nfsio 74081 53115 0 0 3 0x14280 nfsidl nfsio 16884 274546 0 0 3 0x14280 nfsidl nfsio 29448 241769 36432 0 3 0x82 nanoslp syz-executor.0 73672 223401 36432 0 3 0x82 nanoslp syz-executor.1 70440 178500 0 0 3 0x14200 bored sosplice 36432 122734 30236 0 3 0x82 kqread syz-fuzzer 36432 477201 30236 0 3 0x4000082 nanoslp syz-fuzzer 36432 308044 30236 0 3 0x4000082 thrsleep syz-fuzzer 36432 494973 30236 0 3 0x4000082 thrsleep syz-fuzzer 36432 234523 30236 0 3 0x4000082 wait syz-fuzzer 36432 234932 30236 0 3 0x4000082 wait syz-fuzzer 36432 395076 30236 0 3 0x4000082 wait syz-fuzzer 36432 177675 30236 0 3 0x4000082 wait syz-fuzzer 36432 265817 30236 0 3 0x4000082 thrsleep syz-fuzzer 36432 108209 30236 0 3 0x4000082 wait syz-fuzzer 36432 324674 30236 0 3 0x4000082 thrsleep syz-fuzzer 36432 77841 30236 0 3 0x4000082 thrsleep syz-fuzzer 36432 404765 30236 0 3 0x4000082 wait syz-fuzzer 36432 23376 30236 0 3 0x4000082 wait syz-fuzzer 36432 9749 30236 0 3 0x4000082 thrsleep syz-fuzzer 36432 262667 30236 0 3 0x4000082 wait syz-fuzzer 36432 514889 30236 0 3 0x4000082 thrsleep syz-fuzzer 30236 429821 68272 0 3 0x10008a sigsusp ksh 68272 88524 82849 0 3 0x9a kqread sshd 37107 320696 1 0 3 0x100083 ttyin getty 82849 333241 1 0 3 0x88 kqread sshd 25252 261404 86156 74 3 0x1100092 bpf pflogd 86156 416109 1 0 3 0x80 netio pflogd 21139 275329 90436 73 3 0x1100090 kqread syslogd 90436 238379 1 0 3 0x100082 netio syslogd 8756 178265 1 0 3 0x100080 kqread resolvd 83365 55963 0 0 3 0x14200 bored smr 51598 51895 0 0 2 0x14200 zerothread 43509 67932 0 0 3 0x14200 aiodoned aiodoned 75924 493943 0 0 3 0x14200 syncer update 56319 456350 0 0 3 0x14200 cleaner cleaner 24379 34629 0 0 3 0x14200 reaper reaper 55975 162256 0 0 3 0x14200 pgdaemon pagedaemon 86657 424471 0 0 3 0x14200 bored viomb 68264 204990 0 0 3 0x40014200 acpi0 acpi0 5789 113323 0 0 7 0x40014200 idle1 66392 349650 0 0 3 0x14200 bored softnet 69423 327417 0 0 3 0x14200 bored softnet 69962 125023 0 0 3 0x14200 bored softnet 53160 504463 0 0 3 0x14200 bored softnet 31256 150951 0 0 3 0x14200 bored systqmp 76500 412861 0 0 3 0x14200 bored systq 77746 411623 0 0 2 0x40014200 softclock 76689 495501 0 0 3 0x40014200 idle0 1 287832 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10248 6520K 7318K 78643K 18375 0 pcb 13 22K 32K 78643K 4891 0 rtable 228 17K 18K 78643K 4824 0 ifaddr 96 31K 32K 78643K 1757 0 sysctl 3 1K 3K 78643K 10 0 counters 60 35K 36K 78643K 1816 0 ioctlops 0 0K 4K 78643K 3705 0 iov 0 0K 36K 78643K 3235 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1719 107K 108K 78643K 9225 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 361 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 1K 78643K 2836 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 14 49K 85K 78643K 22098 0 sigio 0 0K 0K 78643K 1943 0 proc 66 67K 128K 78643K 3979 0 subproc 104 6K 6K 78643K 1241 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 2030 0 in_multi 79 5K 6K 78643K 1605 0 ether_multi 1 0K 0K 78643K 102 0 mrt 2 0K 0K 78643K 57 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 229 1023K 1023K 78643K 229 0 exec 0 0K 1K 78643K 4268 0 pfkey data 0 0K 0K 78643K 3 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 8 62K 64K 78643K 10 0 UVM amap 399 95K 106K 78643K 160541 0 UVM aobj 131 4K 4K 78643K 132 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 829 0 NDP 17 0K 2K 78643K 619 0 temp 150 5779K 6803K 78643K 135455 0 kqueue 6 10K 26K 78643K 1324 0 SYN cache 2 16K 16K 78643K 2 0 ddb{0}> 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 2250 0 2249 22 21 1 3 0 8 0 rtentry 112 1568 0 1476 4 1 3 4 0 8 0 unpcb 144 20044 0 20036 187 186 1 10 0 8 0 syncache 296 47 0 47 9 9 0 1 0 8 0 tcpqe 32 48 0 48 5 5 0 1 0 8 0 tcpcb 776 6447 0 6441 201 200 1 14 0 8 0 arp 120 241 0 225 1 0 1 1 0 8 0 inpcb 368 21124 0 21116 342 335 7 19 0 8 6 nd6 48 342 0 321 1 0 1 1 0 8 0 pkpcb 40 66 0 66 16 16 0 1 0 8 0 kcovpl 48 95 0 87 1 0 1 1 0 8 0 mppekey 1024 154 0 154 9 9 0 1 0 8 0 ppxss 1256 638 0 638 41 41 0 1 0 8 0 pppxif 1456 400 0 400 22 22 0 1 0 8 0 pfstscr 40 118 0 117 9 8 1 1 0 8 0 pffrag 232 69 0 69 11 10 1 1 0 482 1 pffrnode 88 69 0 69 11 10 1 1 0 8 1 pffrent 40 161 0 161 11 10 1 1 0 8 1 pfosfp 40 1495 0 1071 5 0 5 5 0 8 0 pfosfpen 112 1495 0 780 21 0 21 21 0 8 0 pfanchor 1280 956 340 444 46 3 43 43 0 8 0 pfqueue 264 3 0 3 1 1 0 1 0 8 0 pfstitem 24 105 0 102 1 0 1 1 0 8 0 pfstkey 128 325 0 322 1 0 1 1 0 8 0 pfstate 384 210 0 207 6 5 1 4 0 8 0 pfrule 1344 21 0 20 2 1 1 2 0 8 0 rttmr 136 3 0 3 1 1 0 1 0 8 0 art_heap8 4096 10 0 9 9 8 1 2 0 8 0 art_heap4 256 6961 0 6595 71 47 24 30 0 8 0 art_table 32 6971 0 6604 6 2 4 4 0 8 0 art_node 16 1553 0 1474 1 0 1 1 0 8 0 sysvmsgpl 40 14 0 9 1 0 1 1 0 8 0 semapl 112 2834 0 2824 1 0 1 1 0 8 0 shmpl 112 129 0 1 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 33119 0 31586 97 0 97 97 0 8 0 ffsino 272 33119 0 31586 103 0 103 103 0 8 0 nchpl 144 67305 0 65661 63 0 63 63 0 8 0 rtmask 32 15 0 15 5 5 0 1 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 254698 0 254697 9 8 1 2 0 8 0 percpumem 16 921 0 878 1 0 1 1 0 8 0 vmpool 696 27 0 27 8 8 0 1 0 8 0 kstatmem 264 738 0 704 5 2 3 3 0 8 0 scsiplug 72 14 0 14 4 4 0 1 0 8 0 scxspl 216 188665 0 188665 38 37 1 8 0 8 1 plimitpl 152 3044 0 3029 1 0 1 1 0 8 0 sigapl 424 22459 0 22395 13 5 8 8 0 8 0 futexpl 64 225576 0 225574 2 1 1 1 0 8 0 knotepl 120 1329 0 0 11 0 11 11 0 8 0 kqueuepl 216 4328 0 4323 74 73 1 5 0 8 0 pipepl 320 7807 0 7777 149 146 3 13 0 8 0 fdescpl 496 22218 0 22194 5 1 4 5 0 8 0 filepl 152 181086 0 180857 328 316 12 25 0 8 3 lockfpl 104 5021 0 5020 8 7 1 2 0 8 0 lockfspl 48 1505 0 1504 1 0 1 1 0 8 0 sessionpl 144 111 0 95 1 0 1 1 0 8 0 pgrppl 48 250 0 234 1 0 1 1 0 8 0 ucredpl 104 24692 0 24681 1 0 1 1 0 8 0 zombiepl 144 22397 0 22395 6 5 1 1 0 8 0 processpl 1072 22459 0 22395 6 1 5 5 0 8 0 procpl 696 59084 0 58998 13 3 10 11 0 8 0 srpgc 96 136 0 136 33 33 0 1 0 8 0 sosppl 168 255 0 255 37 37 0 1 0 8 0 sockpl 488 43516 0 43499 909 898 11 35 0 8 8 mcl64k 65536 17 0 0 3 0 3 3 0 8 0 mcl16k 16384 25 0 0 4 1 3 3 0 8 0 mcl12k 12288 27 0 0 2 0 2 2 0 8 0 mcl9k 9216 17 0 0 2 0 2 2 0 8 0 mcl8k 8192 25 0 0 3 0 3 3 0 8 0 mcl4k 4096 25 0 0 3 0 3 3 0 8 0 mcl2k2 2112 6 0 0 1 0 1 1 0 8 0 mcl2k 2048 446 0 0 52 15 37 52 0 8 0 mtagpl 96 120 0 0 3 0 3 3 0 8 0 mbufpl 256 2069 0 0 114 2 112 114 0 8 0 bufpl 288 36021 0 29696 453 0 453 453 0 8 0 anonpl 24 4372328 0 4353797 275 145 130 184 0 186 0 amapchunkpl 152 438934 0 438172 114 74 40 64 0 158 4 amappl16 200 43299 0 42661 254 217 37 47 0 8 2 amappl15 192 13 0 12 2 1 1 1 0 8 0 amappl14 184 517 0 502 2 0 2 2 0 8 0 amappl13 176 46 0 45 1 0 1 1 0 8 0 amappl12 168 1476 0 1467 1 0 1 1 0 8 0 amappl11 160 53 0 45 1 0 1 1 0 8 0 amappl10 152 165 0 149 1 0 1 1 0 8 0 amappl9 144 1032 0 1032 35 35 0 1 0 8 0 amappl8 136 940 0 776 7 1 6 6 0 8 0 amappl7 128 424 0 397 2 0 2 2 0 8 0 amappl6 120 702 0 682 2 1 1 2 0 8 0 amappl5 112 756 0 749 1 0 1 1 0 8 0 amappl4 104 1846 0 1809 3 1 2 2 0 8 0 amappl3 96 64937 0 64893 2 0 2 2 0 8 0 amappl2 88 23814 0 23750 4 2 2 4 0 8 0 amappl1 80 503410 0 502775 28 12 16 28 0 8 0 amappl 88 158342 0 158144 7 1 6 6 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 131 0 1 3 0 3 3 0 8 0 uaddrrnd 24 22245 0 22221 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 22245 0 22221 1 0 1 1 0 8 0 vmmpekpl 168 183097 0 183029 4 0 4 4 0 8 0 vmmpepl 168 2068149 0 2065467 479 335 144 168 0 357 0 vmsppl 440 22244 0 22221 5 1 4 4 0 8 0 rwobjpl 56 545199 0 537364 120 5 115 115 0 8 0 pdppl 4096 44497 0 44442 1336 1273 63 79 0 8 8 pvpl 32 8587536 0 8563619 490 271 219 352 0 265 0 pmappl 248 22244 0 22221 3 1 2 3 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 2655 0 1741 27 0 27 27 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82751deb) at panic+0x177 sys/kern/subr_prf.c:198 __assert(ffffffff827cd2be,ffffffff82818b32,13b,ffffffff827e01fc) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000d64000) at tun_clone_destroy+0x278 sys/net/if_tun.c:315 if_clone_destroy(ffff80002473f660) at if_clone_destroy+0x132 sys/net/if.c:1247 ifioctl(fffffd806d84b3e8,80206979,ffff80002473f660,ffff8000212cdb58) at ifioctl+0x3b4 sys/net/if.c:1924 sys_ioctl(ffff8000212cdb58,ffff80002473f778,ffff80002473f7c0) at sys_ioctl+0x4a2 syscall(ffff80002473f840) at syscall+0x606 mi_syscall sys/sys/syscall_mi.h:110 [inline] syscall(ffff80002473f840) at syscall+0x606 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4d19d328f40, count: -9 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffff800020d68ff0) 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 acpicpu_idle() at acpicpu_idle+0x312 sys/dev/acpi/acpicpu.c:1206 sched_idle(ffff800020d68ff0) at sched_idle+0x417 sys/kern/kern_sched.c:175 end trace frame: 0x0, count: 10 ddb{1}> trace x86_ipi_db(ffff800020d68ff0) 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 acpicpu_idle() at acpicpu_idle+0x312 sys/dev/acpi/acpicpu.c:1206 sched_idle(ffff800020d68ff0) at sched_idle+0x417 sys/kern/kern_sched.c:175 end trace frame: 0x0, count: -5