On Fri, 15 Jun 2018 08:58:17 +0200 Thomas Huth <th...@redhat.com> wrote:
> The rom_ptr() function allows direct access to the ROM blobs that we > load during startup. However, there are currently no checks for the > size of the accesses, so it's currently possible to crash QEMU for > example with: > > $ echo "Insane in the mainframe" > /tmp/test.txt > $ s390x-softmmu/qemu-system-s390x -kernel /tmp/test.txt -append xyz > Segmentation fault (core dumped) > $ s390x-softmmu/qemu-system-s390x -kernel /tmp/test.txt -initrd /tmp/test.txt > Segmentation fault (core dumped) It seems nobody managed to trigger the other places yet? > > We need a possibility to check the size of the ROM area that we want > to access, thus let's add a size parameter to the rom_ptr() function > to avoid these problems. Makes sense. > > Signed-off-by: Thomas Huth <th...@redhat.com> > --- > hw/core/loader.c | 10 +++++----- > hw/mips/mips_malta.c | 6 ++++-- > hw/s390x/ipl.c | 13 ++++++++++--- > hw/sparc/sun4m.c | 2 +- > hw/sparc64/sun4u.c | 2 +- > include/hw/loader.h | 2 +- > target/arm/cpu.c | 2 +- > 7 files changed, 23 insertions(+), 14 deletions(-) > Reviewed-by: Cornelia Huck <coh...@redhat.com>