ARM Highbank Crashes Realted to GIC
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hello,
Here are some QTest reproducers for crashes on ARM Highbank that all seem to be related to the gic device.
Reproducer 1:
cat << EOF | ./arm-softmmu/
-nographic -monitor none -serial none -qtest stdio
writel 0xfff11f00 0x8405f559
writel 0xfff117fd 0x5c057bd8
EOF
==10595==ERROR: AddressSanitizer: SEGV on unknown address 0x62b000013e01 (pc 0x55b6ab85cc91 bp 0x7fff60bd4d70 sp 0x7fff60bd4ce0 T0)
==10595==The signal is caused by a READ memory access.
#0 0x55b6ab85cc91 in gic_get_current_cpu /home/alxndr/
#1 0x55b6ab85e1bd in gic_dist_writeb /home/alxndr/
#2 0x55b6ab855a97 in gic_dist_write /home/alxndr/
#3 0x55b6aa1650d4 in memory_
#4 0x55b6aa163ac6 in access_
#5 0x55b6aa161f35 in memory_
#6 0x55b6a9313949 in flatview_
#7 0x55b6a92fca11 in flatview_write /home/alxndr/
#8 0x55b6a92fc54e in address_space_write /home/alxndr/
=======
Reproducer 2:
cat << EOF | ./arm-softmmu/
-nographic -monitor none -serial none -qtest stdio
writeq 0xfff11f00 0x613a650f0fda6555
EOF
==1375==ERROR: AddressSanitizer: heap-buffer-
READ of size 8 at 0x608000001c80 thread T0
#0 0x5618928c486d in address_
#1 0x561892850acc in flatview_
#2 0x5618928514ad in flatview_translate /home/alxndr/
#3 0x5618928b1e14 in flatview_
#4 0x56189289aa11 in flatview_write /home/alxndr/
#5 0x56189289a54e in address_space_write /home/alxndr/
#6 0x5618937a5e13 in qtest_process_
#7 0x56189379d89f in qtest_process_inbuf /home/alxndr/
#8 0x56189379c680 in qtest_read /home/alxndr/
=======
Reproducer 3:
cat << EOF | ./arm-softmmu/
-nographic -monitor none -serial none -qtest stdio
writeq 0xfff11000 0x700000b
writeq 0xfff11f00 0x4f4f4fff54a7afaf
writel 0xfff10100 0x600001ff
EOF
==23743==ERROR: AddressSanitizer: heap-buffer-
READ of size 1 at 0x62b000006a92 thread T0
#0 0x55d690d980e0 in gic_get_best_irq /home/alxndr/
#1 0x55d690d9485b in gic_update_internal /home/alxndr/
#2 0x55d690d90376 in gic_update /home/alxndr/
#3 0x55d690dc0879 in gic_cpu_write /home/alxndr/
#4 0x55d690da41c0 in gic_thiscpu_write /home/alxndr/
#5 0x55d68f6b30d4 in memory_
#6 0x55d68f6b1ac6 in access_
#7 0x55d68f6aff35 in memory_
#8 0x55d68e861949 in flatview_
#9 0x55d68e84aa11 in flatview_write /home/alxndr/
#10 0x55d68e84a54e in address_space_write /home/alxndr/
#11 0x55d68f755537 in qtest_process_
#12 0x55d68f74d89f in qtest_process_inbuf /home/alxndr/
#13 0x55d68f74c680 in qtest_read /home/alxndr/
#14 0x55d692dddc36 in qemu_chr_
#15 0x55d692dddd79 in qemu_chr_be_write /home/alxndr/
#16 0x55d692df105e in fd_chr_read /home/alxndr/
#17 0x55d692f395df in qio_channel_
#18 0x7f69a1b50897 in g_main_
#19 0x55d6932f5c83 in glib_pollfds_poll /home/alxndr/
#20 0x55d6932f35b6 in os_host_
#21 0x55d6932f2f97 in main_loop_wait /home/alxndr/
#22 0x55d68f76c62d in qemu_main_loop /home/alxndr/
#23 0x55d692f6f20c in main /home/alxndr/
#24 0x7f69a06d6e0a in __libc_start_main /build/
#25 0x55d68e753459 in _start (/home/
0x62b000006a92 is located 2 bytes to the right of 26768-byte region [0x62b000000200
allocated by thread T0 here:
#0 0x55d68e7cbe4d in malloc (/home/
#1 0x7f69a1b56500 in g_malloc (/usr/lib/
#2 0x55d69254f231 in object_new /home/alxndr/
#3 0x55d69034bf01 in qdev_new /home/alxndr/
#4 0x55d68f2b7aa4 in calxeda_init /home/alxndr/
#5 0x55d68f2b6466 in highbank_init /home/alxndr/
#6 0x55d6903d43f1 in machine_
#7 0x55d68f77e0ee in qemu_init /home/alxndr/
#8 0x55d692f6f207 in main /home/alxndr/
#9 0x7f69a06d6e0a in __libc_start_main /build/
Let me know if I can provide any further info.
-Alex
Why put all these bugs in the same ticket?
For reproducer #2:
writeq 0xfff11f00 0x613a650f0fda6555 does:
gic_dist_write dist write at 0x00000f00 size 4: 0x0fda6555
0x0fda6555 => IRQ 341, mask type 3 illegal -> DPRINTF("Bad Soft Int target filter\n");
mask = ALL_CPU_MASK = 0xff
Having:
#define GIC_NR_SGIS 16 GIC_NR_ SGIS][GIC_ NCPU];
uint8_t sgi_pending[
s->sgi_ pending[ irq][target_ cpu] |= (1 << cpu);
^^^
\ OOB access.