edfe2eb436
Per the ARM Generic Interrupt Controller Architecture specification
(document "ARM IHI 0048B.b (ID072613)"), the SGIINTID field is 4 bit,
not 10:
- 4.3 Distributor register descriptions
- 4.3.15 Software Generated Interrupt Register, GICD_SG
- Table 4-21 GICD_SGIR bit assignments
The Interrupt ID of the SGI to forward to the specified CPU
interfaces. The value of this field is the Interrupt ID, in
the range 0-15, for example a value of 0b0011 specifies
Interrupt ID 3.
Correct the irq mask to fix an undefined behavior (which eventually
lead to a heap-buffer-overflow, see [Buglink]):
$ echo 'writel 0x8000f00 0xff4affb0' | qemu-system-aarch64 -M virt,accel=qtest -qtest stdio
[I 1612088147.116987] OPENED
[R +0.278293] writel 0x8000f00 0xff4affb0
../hw/intc/arm_gic.c:1498:13: runtime error: index 944 out of bounds for type 'uint8_t [16][8]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../hw/intc/arm_gic.c:1498:13
This fixes a security issue when running with KVM on Arm with
kernel-irqchip=off. (The default is kernel-irqchip=on, which is
unaffected, and which is also the correct choice for performance.)
Cc: qemu-stable@nongnu.org
Fixes: CVE-2021-20221
Fixes:
|
||
---|---|---|
.. | ||
allwinner-a10-pic.c | ||
apic_common.c | ||
apic.c | ||
arm_gic_common.c | ||
arm_gic_kvm.c | ||
arm_gic.c | ||
arm_gicv2m.c | ||
arm_gicv3_common.c | ||
arm_gicv3_cpuif.c | ||
arm_gicv3_dist.c | ||
arm_gicv3_its_common.c | ||
arm_gicv3_its_kvm.c | ||
arm_gicv3_kvm.c | ||
arm_gicv3_redist.c | ||
arm_gicv3.c | ||
armv7m_nvic.c | ||
aspeed_vic.c | ||
bcm2835_ic.c | ||
bcm2836_control.c | ||
etraxfs_pic.c | ||
exynos4210_combiner.c | ||
exynos4210_gic.c | ||
gic_internal.h | ||
gicv3_internal.h | ||
grlib_irqmp.c | ||
heathrow_pic.c | ||
i8259_common.c | ||
i8259.c | ||
ibex_plic.c | ||
imx_avic.c | ||
imx_gpcv2.c | ||
intc.c | ||
ioapic_common.c | ||
ioapic.c | ||
Kconfig | ||
lm32_pic.c | ||
loongson_liointc.c | ||
meson.build | ||
mips_gic.c | ||
omap_intc.c | ||
ompic.c | ||
openpic_kvm.c | ||
openpic.c | ||
pl190.c | ||
pnv_xive_regs.h | ||
pnv_xive.c | ||
ppc-uic.c | ||
puv3_intc.c | ||
realview_gic.c | ||
rx_icu.c | ||
s390_flic_kvm.c | ||
s390_flic.c | ||
sh_intc.c | ||
sifive_clint.c | ||
sifive_plic.c | ||
slavio_intctl.c | ||
spapr_xive_kvm.c | ||
spapr_xive.c | ||
trace-events | ||
trace.h | ||
vgic_common.h | ||
xics_kvm.c | ||
xics_pnv.c | ||
xics_spapr.c | ||
xics.c | ||
xilinx_intc.c | ||
xive.c | ||
xlnx-pmu-iomod-intc.c | ||
xlnx-zynqmp-ipi.c |