]> git.ipfire.org Git - thirdparty/qemu.git/commit
linux-user: Fixes for zero_bss
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 30 Aug 2023 20:33:54 +0000 (13:33 -0700)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 19 Oct 2023 18:58:31 +0000 (21:58 +0300)
commite73f57b1b57bb41ebbbcb6fe6f75bc8a770d17c7
treefe92f64bdb8ecda178deb10417c8452c3f550e56
parent71452f87c9ad7a205516066f37dfb7e7d12f1d02
linux-user: Fixes for zero_bss

The previous change, 2d385be6152, assumed !PAGE_VALID meant that
the page would be unmapped by the elf image.  However, since we
reserved the entire image space via mmap, PAGE_VALID will always
be set.  Instead, assume PROT_NONE for the same condition.

Furthermore, assume bss is only ever present for writable segments,
and that there is no page overlap between PT_LOAD segments.
Instead of an assert, return false to indicate failure.

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1854
Fixes: 2d385be6152 ("linux-user: Do not adjust zero_bss for host page size")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
(cherry picked from commit e6e66b03287331abc6f184456dbc6d25505590ec)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
linux-user/elfload.c