mirror_qemu/include
Anastasia Belova 357b599028 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:10 +03:00
..
authz Prefer 'on' | 'off' over 'yes' | 'no' for bool options 2021-01-29 17:07:53 +00:00
block nbd: Use enum for various negotiation modes 2023-07-19 15:26:13 -05:00
chardev chardev: src buffer const for write functions 2022-09-29 14:38:05 +04:00
crypto crypto: Unexport AES_*_rot, AES_TeN, AES_TdN 2023-07-09 13:48:23 +01:00
disas disas: Change type of disassemble_info.target_info to pointer 2023-06-13 17:25:47 +10:00
exec accel/tcg: Track current value of can_do_io in the TB 2023-10-03 02:01:36 +03:00
fpu fpu: Add float64_to_int{32,64}_modulo 2023-07-01 08:26:54 +02:00
gdbstub gdbstub: Remove gdb_do_syscallv 2023-03-07 20:44:09 +00:00
hw load_elf: fix iterator's type for elf file processing 2024-01-19 13:41:10 +03:00
io io: remove io watch if TLS channel is closed during handshake 2023-08-01 18:45:27 +01:00
libdecnumber Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
migration migration/ram: Expose ramblock_is_ignored() as migrate_ram_is_ignored() 2023-07-12 09:25:37 +02:00
monitor monitor: add more *_locked() functions 2023-05-25 10:18:33 +02:00
net net: Update MemReentrancyGuard for NIC 2023-11-29 15:35:38 +03:00
qapi monitor: mark mixed functions that can suspend 2023-04-20 11:17:35 +02:00
qemu util/uuid: Remove UUID_FMT_LEN 2023-11-09 16:39:13 +03:00
qom qom/object: Remove circular include dependency 2022-06-28 10:53:32 +02:00
scsi coroutine: Clean up superfluous inclusion of qemu/coroutine.h 2023-01-19 10:18:28 +01:00
semihosting semihosting: Allow optional use of semihosting from userspace 2022-09-13 17:18:21 +01:00
standard-headers linux-headers: update to v6.5-rc1 2023-07-10 09:52:52 +02:00
sysemu hw/xen: select kernel mode for per-vCPU event channel upcall vector 2023-11-09 16:39:13 +03:00
tcg tcg: Reduce tcg_assert_listed_vecop() scope 2023-07-01 08:26:54 +02:00
ui virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties 2023-07-17 15:22:28 +04:00
user *-user: remove the guest_user_syscall tracepoints 2023-06-01 11:03:55 -04:00
elf.h linux-user/elfload: Fix /proc/cpuinfo features: on s390x 2023-07-18 09:36:27 +02:00
glib-compat.h compiler.h: replace QEMU_NORETURN with G_NORETURN 2022-04-21 17:03:51 +04:00
qemu-io.h
qemu-main.h ui/cocoa: Run qemu_init in the main thread 2022-09-23 14:36:33 +02:00