qemu-e2k/hw
Thomas Huth e423455c4f hw/core/loader: Fix possible crash in rom_copy()
Both, "rom->addr" and "addr" are derived from the binary image
that can be loaded with the "-kernel" paramer. The code in
rom_copy() then calculates:

    d = dest + (rom->addr - addr);

and uses "d" as destination in a memcpy() some lines later. Now with
bad kernel images, it is possible that rom->addr is smaller than addr,
thus "rom->addr - addr" gets negative and the memcpy() then tries to
copy contents from the image to a bad memory location. This could
maybe be used to inject code from a kernel image into the QEMU binary,
so we better fix it with an additional sanity check here.

Cc: qemu-stable@nongnu.org
Reported-by: Guangming Liu
Buglink: https://bugs.launchpad.net/qemu/+bug/1844635
Message-Id: <20190925130331.27825-1-thuth@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-10-01 11:42:27 +02:00
..
9pfs
acpi ipmi: Fix SSIF ACPI handling to use the right CRS 2019-09-20 14:08:10 -05:00
adc
alpha
arm hw/arm/boot: Use the IEC binary prefix definitions 2019-09-27 11:44:39 +01:00
audio
block xen-block: treat XenbusStateUnknown the same as XenbusStateClosed 2019-09-24 12:21:11 +01:00
bt
char
core hw/core/loader: Fix possible crash in rom_copy() 2019-10-01 11:42:27 +02:00
cpu
cris
display ati: use vga_read_byte in ati_cursor_define 2019-09-19 10:37:46 +02:00
dma
gpio
hppa
hyperv
i2c
i386 pc: Add an SMB0 ACPI device to q35 2019-09-20 14:09:24 -05:00
ide
input
intc s390x/kvm: Officially require at least kernel 3.15 2019-09-23 09:15:03 +02:00
ipack
ipmi ipmi: Add an SMBus IPMI interface 2019-09-20 14:08:10 -05:00
isa
lm32
m68k hw/m68k/next-cube: Avoid static RTC variables and introduce control register 2019-10-01 11:42:27 +02:00
mem
microblaze
mips
misc trace: Remove trailing newline in events 2019-09-18 10:19:47 +01:00
moxie
net
nios2
nvram
openrisc
pci
pci-bridge
pci-host
pcmcia
ppc
rdma
riscv riscv: sifive_u: Update model and compatible strings in device tree 2019-09-17 08:42:49 -07:00
s390x s390: do not call memory_region_allocate_system_memory() multiple times 2019-09-30 13:51:50 +02:00
scsi trace: Remove trailing newline in events 2019-09-18 10:19:47 +01:00
sd trace: Remove trailing newline in events 2019-09-18 10:19:47 +01:00
semihosting
sh4
smbios smbios:ipmi: Ignore IPMI devices with no fwinfo function 2019-09-20 14:08:10 -05:00
sparc
sparc64
ssi aspeed/smc: Calculate checksum on normal DMA 2019-09-13 16:05:01 +01:00
timer aspeed/scu: Introduce a aspeed_scu_get_apb_freq() routine 2019-09-13 16:05:01 +01:00
tpm
tricore
unicore32
usb
vfio vfio: fix a typo 2019-09-19 11:50:37 +02:00
virtio vhost: Fix memory region section comparison 2019-09-25 10:16:39 -04:00
watchdog
xen xen-bus: only set the xen device frontend state if it is missing 2019-09-24 12:21:29 +01:00
xenpv
xtensa
Kconfig
Makefile.objs