ati-vga: check mm_index before recursive call (CVE-2020-13800)
commita98610c429d52db0937c1e48659428929835c455
authorPrasad J Pandit <pjp@fedoraproject.org>
Thu, 4 Jun 2020 09:08:30 +0000 (4 14:38 +0530)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 5 Jun 2020 07:14:40 +0000 (5 09:14 +0200)
treea161aed3e9c0d0163faa5413db74f6f5ac7b60aa
parent66234fee9c2d37bfbc523aa8d0ae5300a14cc10e
ati-vga: check mm_index before recursive call (CVE-2020-13800)

While accessing VGA registers via ati_mm_read/write routines,
a guest may set 's->regs.mm_index' such that it leads to infinite
recursion. Check mm_index value to avoid such recursion. Log an
error message for wrong values.

Reported-by: Ren Ding <rding@gatech.edu>
Reported-by: Hanqing Zhao <hanqing@gatech.edu>
Reported-by: Yi Ren <c4tren@gmail.com>
Message-id: 20200604090830.33885-1-ppandit@redhat.com
Suggested-by: BALATON Zoltan <balaton@eik.bme.hu>
Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/ati.c