]> git.proxmox.com Git - mirror_qemu.git/commit
linux-user: Use correct types in load_symbols()
authorPeter Maydell <peter.maydell@linaro.org>
Sat, 4 Feb 2017 23:05:33 +0000 (23:05 +0000)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 16 Feb 2017 14:29:30 +0000 (15:29 +0100)
commit1e06262da615fcc0ddd658f96c5673a73b856fb6
treefa9b132e6642534c046b7e9bc0e98f3156a184a6
parent26920a2961f7cc86bfbdb2184c0ec261d5629c2f
linux-user: Use correct types in load_symbols()

Coverity doesn't like the code in load_symbols() which assumes
it can use 'int' for a variable that might hold an offset into
the guest ELF file, because in a 64-bit guest that could
overflow. Guest binaries with 2GB sections aren't very likely
and this isn't a security issue because we fully trust the
guest linux-user binary anyway, but we might as well use the
right types, which will placate Coverity. Use uint64_t to
hold section sizes, and bail out if the symbol table is too
large rather than just overflowing an int.

(Coverity issue CID1005776)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <1486249533-5260-1-git-send-email-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/elfload.c