hw/xen/xen_pt_graphics: Don't trust the BIOS ROM contents so much
Coverity (CID 796599) points out that xen_pt_setup_vga() trusts the rom->size field in the BIOS ROM from a PCI passthrough VGA device, and uses it as an index into the memory which contains the BIOS image. A corrupt BIOS ROM could therefore cause us to index off the end of the buffer. Check that the size is within bounds before we use it. We are also trusting the pcioffset field, and assuming that the whole rom_header is present; Coverity doesn't notice these, but check them too. Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Acked-by: NAnthony PERARD <anthony.perard@citrix.com> Signed-off-by: NAnthony PERARD <anthony.perard@citrix.com>
Showing
想要评论请 注册 或 登录