diff options
| author | Anastasia Belova <abelova@astralinux.ru> | 2024-01-15 12:22:16 +0300 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2024-01-18 12:20:33 +0000 |
| commit | 410c2a4d75f52f6a2fe978eda5a9b6f854afe5ea (patch) | |
| tree | 337fef1005361ba17fd475e84198cc7ff823b4dd /hw/net/virtio-net.c | |
| parent | c2d7faf713e04fc6b2d5b33d77cab0672c5bb30e (diff) | |
| download | focaccia-qemu-410c2a4d75f52f6a2fe978eda5a9b6f854afe5ea.tar.gz focaccia-qemu-410c2a4d75f52f6a2fe978eda5a9b6f854afe5ea.zip | |
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>
Diffstat (limited to 'hw/net/virtio-net.c')
0 files changed, 0 insertions, 0 deletions