[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] linux-user/elfload: do not assume MAP_FIXED_NOREPLACE kernel
Re: [PATCH] linux-user/elfload: do not assume MAP_FIXED_NOREPLACE kernel support
Thu, 25 Feb 2021 08:26:33 -0600
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0
On 2/15/21 3:52 AM, Alex Bennée wrote:
Yes, my builds were happening in a container to eventually have the statically built binaries run in another container.
I discovered this issue (and the two others reviewed) while trying to debootstrap Debian Bullseye in a container.
Vincent Fazio <email@example.com> writes:
Ahh right so I think this is a case of binaries being built on a
different platform than kernel they are running on. In which case the
flag would be defined but the underlying kernel fails to identify it. Is
this a container like case by any chance?
If I'd read the man page closer:
Note that older kernels which do not recognize the
MAP_FIXED_NOREPLACE flag will typically (upon detecting a colli‐
sion with a preexisting mapping) fall back to a "non-MAP_FIXED"
type of behavior: they will return an address that is different
from the requested address. Therefore, backward-compatible
software should check the returned address against the requested
so yes we should avoid short circuiting the return address check.
Reviewed-by: Alex Bennée <firstname.lastname@example.org>