aboutsummaryrefslogtreecommitdiff
path: root/hw/display
diff options
context:
space:
mode:
authorBALATON Zoltan <balaton@eik.bme.hu>2020-05-16 15:13:03 +0200
committerGerd Hoffmann <kraxel@redhat.com>2020-05-18 15:39:59 +0200
commitb0588cb51da6986715294bfec4b52f55612a666e (patch)
treebbdedf8ab7e813761813270e690d764ab5b371eb /hw/display
parentdebe78ce14bf8f8940c2bdf3ef387505e9e035a9 (diff)
downloadqemu-b0588cb51da6986715294bfec4b52f55612a666e.zip
qemu-b0588cb51da6986715294bfec4b52f55612a666e.tar.gz
qemu-b0588cb51da6986715294bfec4b52f55612a666e.tar.bz2
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>
Diffstat (limited to 'hw/display')
-rw-r--r--hw/display/ati.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/display/ati.c b/hw/display/ati.c
index 58ec829..065f197 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -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 */