]> Git Repo - qemu.git/commitdiff
ati-vga: Do not allow unaligned access via index register
authorBALATON Zoltan <[email protected]>
Sat, 16 May 2020 13:13:03 +0000 (15:13 +0200)
committerGerd Hoffmann <[email protected]>
Mon, 18 May 2020 13:39:59 +0000 (15:39 +0200)
According to docs bits 1 and 0 of MM_INDEX are hard coded to 0 so
unaligned access via this register should not be possible.
This also fixes problems reported in bug #1878134.

Buglink: https://bugs.launchpad.net/qemu/+bug/1878134
Signed-off-by: BALATON Zoltan <[email protected]>
Tested-by: Alexander Bulekov <[email protected]>
Acked-by: Alexander Bulekov <[email protected]>
Message-id: 20200516132352.39E9374594E@zero.eik.bme.hu
Signed-off-by: Gerd Hoffmann <[email protected]>
hw/display/ati.c

index 58ec8291d4601b70720fa1484f88686d47b33a0a..065f197678e49faeb45cd29de59f753699f42c41 100644 (file)
@@ -511,7 +511,7 @@ static void ati_mm_write(void *opaque, hwaddr addr,
     }
     switch (addr) {
     case MM_INDEX:
-        s->regs.mm_index = data;
+        s->regs.mm_index = data & ~3;
         break;
     case MM_DATA ... MM_DATA + 3:
         /* indexed access to regs or memory */
This page took 0.021588 seconds and 4 git commands to generate.