On 2/15/21 3:52 AM, Alex Bennée wrote:
Vincent Fazio <vfa...@gmail.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?
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.
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
address.
so yes we should avoid short circuiting the return address check.
Reviewed-by: Alex Bennée <alex.ben...@linaro.org>