All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ati-vga: Do not allow unaligned access via index register
@ 2020-05-16 13:13 BALATON Zoltan
  2020-05-16 14:47 ` Alexander Bulekov
  0 siblings, 1 reply; 8+ messages in thread
From: BALATON Zoltan @ 2020-05-16 13:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

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.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
 hw/display/ati.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/display/ati.c b/hw/display/ati.c
index f4c4542751..2ee23173b2 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -531,7 +531,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 */
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-18 13:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-16 13:13 [PATCH] ati-vga: Do not allow unaligned access via index register BALATON Zoltan
2020-05-16 14:47 ` Alexander Bulekov
2020-05-16 15:33   ` BALATON Zoltan
2020-05-17 10:40     ` Philippe Mathieu-Daudé
2020-05-17 13:12       ` Philippe Mathieu-Daudé
2020-05-17 14:30         ` BALATON Zoltan
2020-05-17 17:54           ` Philippe Mathieu-Daudé
2020-05-18 13:37           ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.