]> git.ipfire.org Git - thirdparty/qemu.git/commit
linux-user: Fix parse_elf_properties GNU0_MAGIC check
authorRichard Henderson <richard.henderson@linaro.org>
Sat, 5 Oct 2024 16:01:22 +0000 (09:01 -0700)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 10 Oct 2024 18:04:46 +0000 (21:04 +0300)
commit709e6ab5ab2263725b8d3a315aae9bf08c1c39ec
tree94e2737913e509bf51237c2aeb95774826fb61d8
parent49d42ed3bd39dd495b5e4b2e976b4723d2d9e62f
linux-user: Fix parse_elf_properties GNU0_MAGIC check

Comparing a string of 4 bytes only works in little-endian.

Adjust bulk bswap to only apply to the note payload.
Perform swapping of the note header manually; the magic
is defined so that it does not need a runtime swap.

Fixes: 83f990eb5adb ("linux-user/elfload: Parse NT_GNU_PROPERTY_TYPE_0 notes")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2596
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit 2884596f5f385b5712c356310dd4125a089888a8)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
linux-user/elfload.c