mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-07 00:30:43 -07:00
Regression introduced by cf76c4
(hw/misc: Add nr_regs and cold_reset_values to NPCM CLK)
cold_reset_values has a different size, depending on device used
(NPCM7xx vs NPCM8xx). However, s->regs has a fixed size, which matches
NPCM8xx. Thus, when initializing a NPCM7xx, we go past cold_reset_values
ending.
Report by asan:
==2066==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55d68a3e97f0 at pc 0x7fcaf2b2d14b bp 0x7ffff0cc3890 sp 0x7ffff0cc3040
READ of size 196 at 0x55d68a3e97f0 thread T0
#0 0x7fcaf2b2d14a in __interceptor_memcpy ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:827
#1 0x55d688447e0d in memcpy /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29
#2 0x55d688447e0d in npcm_clk_enter_reset ../hw/misc/npcm_clk.c:968
#3 0x55d6899b7213 in resettable_phase_enter ../hw/core/resettable.c:136
#4 0x55d6899a1ef7 in bus_reset_child_foreach ../hw/core/bus.c:97
#5 0x55d6899b717d in resettable_child_foreach ../hw/core/resettable.c:92
#6 0x55d6899b717d in resettable_phase_enter ../hw/core/resettable.c:129
#7 0x55d6899b4ead in resettable_container_child_foreach ../hw/core/resetcontainer.c:54
#8 0x55d6899b717d in resettable_child_foreach ../hw/core/resettable.c:92
#9 0x55d6899b717d in resettable_phase_enter ../hw/core/resettable.c:129
#10 0x55d6899b7bfa in resettable_assert_reset ../hw/core/resettable.c:55
#11 0x55d6899b8666 in resettable_reset ../hw/core/resettable.c:45
#12 0x55d688d15cd2 in qemu_system_reset ../system/runstate.c:527
#13 0x55d687fc5edd in qdev_machine_creation_done ../hw/core/machine.c:1738
#14 0x55d688d209bd in qemu_machine_creation_done ../system/vl.c:2779
#15 0x55d688d209bd in qmp_x_exit_preconfig ../system/vl.c:2807
#16 0x55d688d281fb in qemu_init ../system/vl.c:3838
#17 0x55d687ceab12 in main ../system/main.c:68
#18 0x7fcaef006249 (/lib/x86_64-linux-gnu/libc.so.6+0x27249)
#19 0x7fcaef006304 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x27304)
#20 0x55d687cf0010 in _start (/home/runner/work/qemu-ci/qemu-ci/build/qemu-system-arm+0x371c010)
0x55d68a3e97f0 is located 0 bytes to the right of global variable 'npcm7xx_cold_reset_values' defined in '../hw/misc/npcm_clk.c:134:23' (0x55d68a3e9780) of size 112
Impacted tests:
Summary of Failures:
check:
2/747 qemu:qtest+qtest-aarch64 / qtest-aarch64/qom-test ERROR 9.28s killed by signal 6 SIGABRT
4/747 qemu:qtest+qtest-arm / qtest-arm/qom-test ERROR 7.82s killed by signal 6 SIGABRT
32/747 qemu:qtest+qtest-aarch64 / qtest-aarch64/device-introspect-test ERROR 10.91s killed by signal 6 SIGABRT
35/747 qemu:qtest+qtest-arm / qtest-arm/device-introspect-test ERROR 11.33s killed by signal 6 SIGABRT
114/747 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_pwm-test ERROR 0.98s killed by signal 6 SIGABRT
115/747 qemu:qtest+qtest-aarch64 / qtest-aarch64/test-hmp ERROR 2.95s killed by signal 6 SIGABRT
117/747 qemu:qtest+qtest-arm / qtest-arm/test-hmp ERROR 2.54s killed by signal 6 SIGABRT
151/747 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_watchdog_timer-test ERROR 0.96s killed by signal 6 SIGABRT
247/747 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_adc-test ERROR 0.96s killed by signal 6 SIGABRT
248/747 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_gpio-test ERROR 1.05s killed by signal 6 SIGABRT
249/747 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_rng-test ERROR 0.97s killed by signal 6 SIGABRT
250/747 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_sdhci-test ERROR 0.97s killed by signal 6 SIGABRT
251/747 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_smbus-test ERROR 0.89s killed by signal 6 SIGABRT
252/747 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_timer-test ERROR 1.09s killed by signal 6 SIGABRT
253/747 qemu:qtest+qtest-arm / qtest-arm/npcm_gmac-test ERROR 1.12s killed by signal 6 SIGABRT
255/747 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_emc-test ERROR 1.05s killed by signal 6 SIGABRT
check-functional:
22/203 qemu:func-thorough+func-arm-thorough+thorough / func-arm-arm_quanta_gsj ERROR 0.79s exit status 1
38/203 qemu:func-quick+func-aarch64 / func-aarch64-migration ERROR 1.97s exit status 1
45/203 qemu:func-quick+func-arm / func-arm-migration ERROR 1.90s exit status 1
Fixes:
|
||
|---|---|---|
| .. | ||
| macio | ||
| a9scu.c | ||
| allwinner-a10-ccm.c | ||
| allwinner-a10-dramc.c | ||
| allwinner-cpucfg.c | ||
| allwinner-h3-ccu.c | ||
| allwinner-h3-dramc.c | ||
| allwinner-h3-sysctrl.c | ||
| allwinner-r40-ccu.c | ||
| allwinner-r40-dramc.c | ||
| allwinner-sid.c | ||
| allwinner-sramc.c | ||
| applesmc.c | ||
| arm11scu.c | ||
| arm_integrator_debug.c | ||
| arm_l2x0.c | ||
| arm_sysctl.c | ||
| armsse-cpu-pwrctrl.c | ||
| armsse-cpuid.c | ||
| armsse-mhu.c | ||
| armv7m_ras.c | ||
| aspeed_hace.c | ||
| aspeed_i3c.c | ||
| aspeed_lpc.c | ||
| aspeed_peci.c | ||
| aspeed_sbc.c | ||
| aspeed_scu.c | ||
| aspeed_sdmc.c | ||
| aspeed_sli.c | ||
| aspeed_xdma.c | ||
| auxbus.c | ||
| avr_power.c | ||
| axp2xx.c | ||
| bcm2835_cprman.c | ||
| bcm2835_mbox.c | ||
| bcm2835_mphi.c | ||
| bcm2835_powermgt.c | ||
| bcm2835_property.c | ||
| bcm2835_rng.c | ||
| bcm2835_thermal.c | ||
| debugexit.c | ||
| djmemc.c | ||
| eccmemctl.c | ||
| edu.c | ||
| empty_slot.c | ||
| exynos4210_clk.c | ||
| exynos4210_pmu.c | ||
| exynos4210_rng.c | ||
| grlib_ahb_apb_pnp.c | ||
| i2c-echo.c | ||
| imx6_ccm.c | ||
| imx6_src.c | ||
| imx6ul_ccm.c | ||
| imx7_ccm.c | ||
| imx7_gpr.c | ||
| imx7_snvs.c | ||
| imx7_src.c | ||
| imx25_ccm.c | ||
| imx31_ccm.c | ||
| imx_ccm.c | ||
| imx_rngc.c | ||
| iosb.c | ||
| iotkit-secctl.c | ||
| iotkit-sysctl.c | ||
| iotkit-sysinfo.c | ||
| ivshmem-flat.c | ||
| ivshmem-pci.c | ||
| Kconfig | ||
| lasi.c | ||
| led.c | ||
| mac_via.c | ||
| mchp_pfsoc_dmc.c | ||
| mchp_pfsoc_ioscb.c | ||
| mchp_pfsoc_sysreg.c | ||
| meson.build | ||
| mips_cmgcr.c | ||
| mips_cpc.c | ||
| mips_itu.c | ||
| mos6522.c | ||
| mps2-fpgaio.c | ||
| mps2-scc.c | ||
| msf2-sysreg.c | ||
| npcm7xx_mft.c | ||
| npcm7xx_pwm.c | ||
| npcm7xx_rng.c | ||
| npcm_clk.c | ||
| npcm_gcr.c | ||
| nrf51_rng.c | ||
| omap_clk.c | ||
| pc-testdev.c | ||
| pci-testdev.c | ||
| pvpanic-isa.c | ||
| pvpanic-pci.c | ||
| pvpanic.c | ||
| sbsa_ec.c | ||
| sifive_e_aon.c | ||
| sifive_e_prci.c | ||
| sifive_test.c | ||
| sifive_u_otp.c | ||
| sifive_u_prci.c | ||
| slavio_misc.c | ||
| stm32_rcc.c | ||
| stm32f2xx_syscfg.c | ||
| stm32f4xx_exti.c | ||
| stm32f4xx_syscfg.c | ||
| stm32l4x5_exti.c | ||
| stm32l4x5_rcc.c | ||
| stm32l4x5_syscfg.c | ||
| trace-events | ||
| trace.h | ||
| tz-mpc.c | ||
| tz-msc.c | ||
| tz-ppc.c | ||
| unimp.c | ||
| virt_ctrl.c | ||
| vmcoreinfo.c | ||
| xlnx-cfi-if.c | ||
| xlnx-versal-cframe-reg.c | ||
| xlnx-versal-cfu.c | ||
| xlnx-versal-crl.c | ||
| xlnx-versal-pmc-iou-slcr.c | ||
| xlnx-versal-trng.c | ||
| xlnx-versal-xramc.c | ||
| xlnx-zynqmp-apu-ctrl.c | ||
| xlnx-zynqmp-crf.c | ||
| zynq_slcr.c | ||