Procházet zdrojové kódy

ati-vga: Do not allow unaligned access via index register

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 <balaton@eik.bme.hu>
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Acked-by: Alexander Bulekov <alxndr@bu.edu>
Message-id: 20200516132352.39E9374594E@zero.eik.bme.hu
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
BALATON Zoltan před 5 roky
rodič
revize
b0588cb51d
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      hw/display/ati.c

+ 1 - 1
hw/display/ati.c

@@ -511,7 +511,7 @@ static void ati_mm_write(void *opaque, hwaddr addr,
     }
     }
     switch (addr) {
     switch (addr) {
     case MM_INDEX:
     case MM_INDEX:
-        s->regs.mm_index = data;
+        s->regs.mm_index = data & ~3;
         break;
         break;
     case MM_DATA ... MM_DATA + 3:
     case MM_DATA ... MM_DATA + 3:
         /* indexed access to regs or memory */
         /* indexed access to regs or memory */