qemu-e2k/hw/core
Thomas Huth 0f0f8b611e loader: Check access size when calling rom_ptr() to avoid crashes
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)
$ echo -n HdrS > /tmp/hdr.txt
$ sparc64-softmmu/qemu-system-sparc64 -kernel /tmp/hdr.txt -initrd /tmp/hdr.txt
Segmentation fault (core dumped)

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.

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1530005740-25254-1-git-send-email-thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2018-07-02 10:37:38 +02:00
..
bus.c Revert "bus: do not unref the added child bus on realize" 2018-06-18 09:15:51 +02:00
empty_slot.c
fw-path-provider.c
generic-loader.c
hotplug.c
irq.c
loader-fit.c hw: Do not include "exec/address-spaces.h" if it is not necessary 2018-06-01 14:15:10 +02:00
loader.c loader: Check access size when calling rom_ptr() to avoid crashes 2018-07-02 10:37:38 +02:00
machine.c numa: postpone options post-processing till machine_run_board_init() 2018-05-30 13:08:11 -03:00
Makefile.objs
nmi.c
null-machine.c
or-irq.c hw/core/or-irq: Support more than 16 inputs to an OR gate 2018-06-15 15:23:34 +01:00
platform-bus.c hw: Do not include "exec/address-spaces.h" if it is not necessary 2018-06-01 14:15:10 +02:00
ptimer.c
qdev-fw.c
qdev-properties-system.c net: Remove the deprecated "vlan" parameter 2018-05-14 15:47:14 +08:00
qdev-properties.c object: fix OBJ_PROP_LINK_UNREF_ON_RELEASE ambivalence 2018-06-12 12:07:30 +02:00
qdev.c object: fix OBJ_PROP_LINK_UNREF_ON_RELEASE ambivalence 2018-06-12 12:07:30 +02:00
register.c hw/core/register: Add trailing '\n' to qemu_log() call 2018-06-08 13:15:33 +01:00
reset.c
split-irq.c
stream.c
sysbus.c qdev: Simplify the SysBusDeviceClass::init path 2018-06-01 15:14:31 +02:00
uboot_image.h