Message ID | 20200603202251.1199170-2-ppandit@redhat.com |
---|---|
State | New |
Headers | show |
Series | Ensure PCI configuration access is within bounds | expand |
diff --git a/hw/display/ati.c b/hw/display/ati.c index bda4a2d816..6671959e5d 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -384,7 +384,10 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size) val = s->regs.crtc_pitch; break; case 0xf00 ... 0xfff: - val = pci_default_read_config(&s->dev, addr - 0xf00, size); + addr = addr - 0xf00; + if (addr + size <= 0xff) { + val = pci_default_read_config(&s->dev, addr, size); + } break; case CUR_OFFSET: val = s->regs.cur_offset;