qemu-e2k/hw
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
..
9pfs 9p: darwin: Explicitly cast comparisons of mode_t with -1 2018-06-29 12:32:10 +02:00
acpi
adc
alpha
arm i.mx7d: Change IRQ number type from hwaddr to int 2018-06-29 15:11:17 +01:00
audio
block Pull request 2018-06-30 13:59:53 +01:00
bt
char Pull request 2018-06-30 13:59:53 +01:00
core loader: Check access size when calling rom_ptr() to avoid crashes 2018-07-02 10:37:38 +02:00
cpu
cris
display
dma
gpio
hppa
i2c
i386 hmp: obsolete "info ioapic" 2018-06-28 19:05:37 +02:00
ide
input hw/input/tsc2005: Convert a fprintf() call to trace events 2018-06-29 15:04:18 +01:00
intc hmp: obsolete "info ioapic" 2018-06-28 19:05:37 +02:00
ipack
ipmi
isa
lm32
m68k
mem pc-dimm: get_memory_region() will not fail after realize 2018-06-28 19:05:34 +02:00
microblaze
mips loader: Check access size when calling rom_ptr() to avoid crashes 2018-07-02 10:37:38 +02:00
misc
moxie
net hw/net/etraxfs_eth: Convert printf() calls to trace events 2018-06-29 15:04:18 +01:00
nios2
nvram
openrisc
pci
pci-bridge
pci-host
pcmcia
ppc pc-dimm: get_memory_region() will not fail after realize 2018-06-28 19:05:34 +02:00
rdma
riscv
s390x loader: Check access size when calling rom_ptr() to avoid crashes 2018-07-02 10:37:38 +02:00
scsi Block layer patches: 2018-06-29 18:29:15 +01:00
sd Pull request 2018-06-30 13:59:53 +01:00
sh4
smbios
sparc loader: Check access size when calling rom_ptr() to avoid crashes 2018-07-02 10:37:38 +02:00
sparc64 loader: Check access size when calling rom_ptr() to avoid crashes 2018-07-02 10:37:38 +02:00
ssi
timer
tpm
tricore
unicore32
usb usb-storage: Add rerror/werror properties 2018-06-29 14:20:56 +02:00
vfio
virtio
watchdog
xen
xenpv
xtensa
Makefile.objs