syzbot


netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic

Status: fixed on 2023/03/29 14:18
Reported-by: syzbot+361cecdd4307323c1ee2@syzkaller.appspotmail.com
Fix commit: 317ef74dd360 vioif(4): fix wrong memory allocation size
First crash: 609d, last: 608d

Sample crash report:
[   1.0360731] panic: ASan: Unauthorized Access In 0xffffffff81bcc7b1: Addr 0xffff930010cc07a0 [56 bytes, write, KmemRedZone]

[   1.0360731] cpu0: Begin traceback...
[   1.0360731] vpanic() at netbsd:vpanic+0x282 sys/kern/subr_prf.c:291
[   1.0360731] panic() at netbsd:panic+0x9e sys/kern/subr_prf.c:1059
[   1.0360731] kasan_report() at netbsd:kasan_report+0x8f kasan_code_name sys/kern/subr_asan.c:168 [inline]
[   1.0360731] kasan_report() at netbsd:kasan_report+0x8f sys/kern/subr_asan.c:200
[   1.0360731] kasan_memset() at netbsd:kasan_memset+0x7b kasan_shadow_Nbyte_isvalid sys/kern/subr_asan.c:382 [inline]
[   1.0360731] kasan_memset() at netbsd:kasan_memset+0x7b kasan_shadow_check sys/kern/subr_asan.c:427 [inline]
[   1.0360731] kasan_memset() at netbsd:kasan_memset+0x7b sys/kern/subr_asan.c:456
[   1.0360731] evcnt_attach_dynamic() at netbsd:evcnt_attach_dynamic+0x34 evcnt_attach_dynamic_nozero sys/kern/subr_evcnt.c:185 [inline]
[   1.0360731] evcnt_attach_dynamic() at netbsd:evcnt_attach_dynamic+0x34 sys/kern/subr_evcnt.c:201
[   1.0360731] vioif_attach() at netbsd:vioif_attach+0x27f7 vioif_setup_stats sys/dev/pci/if_vioif.c:1048 [inline]
[   1.0360731] vioif_attach() at netbsd:vioif_attach+0x27f7 sys/dev/pci/if_vioif.c:634
[   1.0360731] config_attach_internal() at netbsd:config_attach_internal+0x341 sys/kern/subr_autoconf.c:1785
[   1.0360731] config_found() at netbsd:config_found+0x1e3 sys/kern/subr_autoconf.c:1272
[   1.0360731] virtio_pci_rescan() at netbsd:virtio_pci_rescan+0xd4 sys/dev/pci/virtio_pci.c:318
[   1.0360731] virtio_pci_attach() at netbsd:virtio_pci_attach+0x491 sys/dev/pci/virtio_pci.c:299
[   1.0360731] config_attach_internal() at netbsd:config_attach_internal+0x341 sys/kern/subr_autoconf.c:1785
[   1.0360731] config_found() at netbsd:config_found+0x1e3 sys/kern/subr_autoconf.c:1272
[   1.0360731] pci_probe_device() at netbsd:pci_probe_device+0xf77 sys/dev/pci/pci.c:488
[   1.0360731] pci_enumerate_bus() at netbsd:pci_enumerate_bus+0x426 sys/dev/pci/pci.c:819
[   1.0360731] pcirescan() at netbsd:pcirescan+0x71 sys/dev/pci/pci.c:113
[   1.0360731] pciattach() at netbsd:pciattach+0x310 sys/dev/pci/pci.c:210
[   1.0360731] config_attach_internal() at netbsd:config_attach_internal+0x341 sys/kern/subr_autoconf.c:1785
[   1.0360731] config_found() at netbsd:config_found+0x1e3 sys/kern/subr_autoconf.c:1272
[   1.0360731] mp_pci_scan() at netbsd:mp_pci_scan+0x265 sys/arch/x86/x86/mp.c:96
[   1.0360731] amd64_mainbus_attach() at netbsd:amd64_mainbus_attach+0x867 sys/arch/amd64/amd64/amd64_mainbus.c:213
[   1.0360731] mainbus_attach() at netbsd:mainbus_attach+0x1a2 sys/arch/x86/x86/mainbus.c:216
[   1.0360731] config_attach_internal() at netbsd:config_attach_internal+0x341 sys/kern/subr_autoconf.c:1785
[   1.0360731] config_rootfound() at netbsd:config_rootfound+0xda config_attach sys/kern/subr_autoconf.c:1820 [inline]
[   1.0360731] config_rootfound() at netbsd:config_rootfound+0xda sys/kern/subr_autoconf.c:1300
[   1.0360731] cpu_configure() at netbsd:cpu_configure+0x68 sys/arch/amd64/amd64/autoconf.c:112
[   1.0360731] main() at netbsd:main+0x4b8 sys/kern/init_main.c:555
[   1.0360731] cpu0: End traceback...
[   1.0360731] fatal breakpoint trap in supervisor mode
[   1.0360731] trap type 1 code 0 rip 0xffffffff8023230d cs 0x8 rflags 0x202 cr2 0 ilevel 0x8 rsp 0xffffffff8387d790
[   1.0360731] curlwp 0xffffffff83347940 pid 0.0 lowest kstack 0xffffffff838772c0
Stopped in pid 0.0 (system) at  netbsd:breakpoint+0x5:  leave
breakpoint() at netbsd:breakpoint+0x5
db_panic() at netbsd:db_panic+0x105 sys/ddb/db_panic.c:69
vpanic() at netbsd:vpanic+0x282 sys/kern/subr_prf.c:291
panic() at netbsd:panic+0x9e sys/kern/subr_prf.c:1059
kasan_report() at netbsd:kasan_report+0x8f kasan_code_name sys/kern/subr_asan.c:168 [inline]
kasan_report() at netbsd:kasan_report+0x8f sys/kern/subr_asan.c:200
kasan_memset() at netbsd:kasan_memset+0x7b kasan_shadow_Nbyte_isvalid sys/kern/subr_asan.c:382 [inline]
kasan_memset() at netbsd:kasan_memset+0x7b kasan_shadow_check sys/kern/subr_asan.c:427 [inline]
kasan_memset() at netbsd:kasan_memset+0x7b sys/kern/subr_asan.c:456
evcnt_attach_dynamic() at netbsd:evcnt_attach_dynamic+0x34 evcnt_attach_dynamic_nozero sys/kern/subr_evcnt.c:185 [inline]
evcnt_attach_dynamic() at netbsd:evcnt_attach_dynamic+0x34 sys/kern/subr_evcnt.c:201
vioif_attach() at netbsd:vioif_attach+0x27f7 vioif_setup_stats sys/dev/pci/if_vioif.c:1048 [inline]
vioif_attach() at netbsd:vioif_attach+0x27f7 sys/dev/pci/if_vioif.c:634
config_attach_internal() at netbsd:config_attach_internal+0x341 sys/kern/subr_autoconf.c:1785
config_found() at netbsd:config_found+0x1e3 sys/kern/subr_autoconf.c:1272
virtio_pci_rescan() at netbsd:virtio_pci_rescan+0xd4 sys/dev/pci/virtio_pci.c:318
virtio_pci_attach() at netbsd:virtio_pci_attach+0x491 sys/dev/pci/virtio_pci.c:299
config_attach_internal() at netbsd:config_attach_internal+0x341 sys/kern/subr_autoconf.c:1785
config_found() at netbsd:config_found+0x1e3 sys/kern/subr_autoconf.c:1272
pci_probe_device() at netbsd:pci_probe_device+0xf77 sys/dev/pci/pci.c:488
pci_enumerate_bus() at netbsd:pci_enumerate_bus+0x426 sys/dev/pci/pci.c:819
pcirescan() at netbsd:pcirescan+0x71 sys/dev/pci/pci.c:113
pciattach() at netbsd:pciattach+0x310 sys/dev/pci/pci.c:210
config_attach_internal() at netbsd:config_attach_internal+0x341 sys/kern/subr_autoconf.c:1785
config_found() at netbsd:config_found+0x1e3 sys/kern/subr_autoconf.c:1272
mp_pci_scan() at netbsd:mp_pci_scan+0x265 sys/arch/x86/x86/mp.c:96
amd64_mainbus_attach() at netbsd:amd64_mainbus_attach+0x867 sys/arch/amd64/amd64/amd64_mainbus.c:213
--db_more--

Crashes (33):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/03/24 16:48 netbsd 21746ce2933d 9700afae .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/24 16:48 netbsd 21746ce2933d 9700afae .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/24 16:47 netbsd 21746ce2933d 9700afae .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/24 15:12 netbsd 2b37664c4382 9700afae .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/24 15:12 netbsd 2b37664c4382 9700afae .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/24 15:12 netbsd 2b37664c4382 9700afae .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/24 13:23 netbsd 2b37664c4382 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/24 13:23 netbsd 2b37664c4382 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/24 13:23 netbsd 2b37664c4382 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/24 01:59 netbsd 10808e928e94 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/24 01:59 netbsd 10808e928e94 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/24 01:58 netbsd 10808e928e94 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 23:11 netbsd 694b95b79ba9 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 23:11 netbsd 694b95b79ba9 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 23:11 netbsd 694b95b79ba9 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 20:42 netbsd 474ba2351ae6 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 20:42 netbsd 474ba2351ae6 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 20:41 netbsd 474ba2351ae6 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 17:58 netbsd b96529fbe61a f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 17:58 netbsd b96529fbe61a f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 17:58 netbsd b96529fbe61a f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 16:19 netbsd b96529fbe61a f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 16:19 netbsd b96529fbe61a f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 16:19 netbsd b96529fbe61a f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 12:59 netbsd f1da73560a85 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 12:59 netbsd f1da73560a85 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 12:59 netbsd f1da73560a85 f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 09:58 netbsd 0c3845a212bd f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 09:58 netbsd 0c3845a212bd f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 09:58 netbsd 0c3845a212bd f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 07:16 netbsd 7d5560eb106d f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 07:16 netbsd 7d5560eb106d f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
2023/03/23 07:16 netbsd 7d5560eb106d f94b4a29 .config console log report ci2-netbsd netbsd boot error: ASan: Unauthorized Access in evcnt_attach_dynamic
* Struck through repros no longer work on HEAD.