mbox series

[0/5] hw/core/loader: Prohibit loading ROMs bigger than memory region

Message ID 20200309144353.26457-1-philmd@redhat.com (mailing list archive)
Headers show
Series hw/core/loader: Prohibit loading ROMs bigger than memory region | expand

Message

Philippe Mathieu-Daudé March 9, 2020, 2:43 p.m. UTC
This series fixes a bug where an user can load ROMs bigger
than the expected size. The bug is delayed after a reset where
rom_reset() can overflow the underlying memory regions.

Philippe Mathieu-Daudé (5):
  hw/sparc64/niagara: Pass available memory region size to
    add_rom_or_fail
  hw/core/loader: Prohibit loading ROMs bigger than memory region
  hw/core/loader: Provide rom_add_file() a 'max_size' argument
  hw/core/loader: Restrict rom_add_file_mr() to available region size
  hw/core/loader: Provide rom_add_file_fixed() a 'max_size' argument

 include/hw/loader.h  | 12 ++++++------
 hw/core/loader.c     | 24 +++++++++++++++++-------
 hw/i386/x86.c        |  2 +-
 hw/ppc/sam460ex.c    |  2 +-
 hw/sparc64/niagara.c | 22 +++++++++++++---------
 5 files changed, 38 insertions(+), 24 deletions(-)