diff options
author | Anastasia Belova <abelova@astralinux.ru> | 2024-01-15 12:22:16 +0300 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2024-01-19 13:41:06 +0300 |
commit | 72dd722370864fbd4bedb218a8df6b71867c47e1 (patch) | |
tree | b3280c5cd597e3ec88f682657ef013dc8e6c90d0 /dump | |
parent | 872377f264ca5b6db416c1f4db8c4e9ecbfbb03c (diff) | |
download | qemu-72dd722370864fbd4bedb218a8df6b71867c47e1.zip qemu-72dd722370864fbd4bedb218a8df6b71867c47e1.tar.gz qemu-72dd722370864fbd4bedb218a8df6b71867c47e1.tar.bz2 |
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 410c2a4d75f52f6a2fe978eda5a9b6f854afe5ea)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'dump')
0 files changed, 0 insertions, 0 deletions