qemu/include
Anastasia Belova 72dd722370 load_elf: fix iterator's type for elf file processing
j is used while loading an ELF file to byteswap segments'
data. If data is larger than 2GB an overflow may happen.
So j should be elf_word.

This commit fixes a minor bug: it's unlikely anybody is trying to
load ELF files with 2GB+ segments for wrong-endianness targets,
but if they did, it wouldn't work correctly.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Cc: qemu-stable@nongnu.org
Fixes: 7ef295ea5b ("loader: Add data swap option to load-elf")
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 410c2a4d75)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-01-19 13:41:06 +03:00
..
authz
block block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
chardev
crypto
disas
exec accel/tcg: Remove CF_LAST_IO 2023-11-14 10:40:54 -08:00
fpu
gdbstub
hw load_elf: fix iterator's type for elf file processing 2024-01-19 13:41:06 +03:00
io
libdecnumber
migration
monitor
net net: Update MemReentrancyGuard for NIC 2023-11-21 15:42:34 +08:00
qapi
qemu osdep: add getloadavg 2023-12-01 08:53:04 -05:00
qom
scsi
semihosting
standard-headers
sysemu
tcg
ui include/ui/rect.h: fix qemu_rect_init() mis-assignment 2023-12-26 18:10:36 +03:00
user
elf.h
glib-compat.h
qemu-io.h
qemu-main.h