Re: MAP_FIXED_NOREPLACE appears to break older i386 binaries

From: Linus Torvalds
Date: Sat Oct 05 2019 - 20:07:04 EST


On Sat, Oct 5, 2019 at 4:32 PM Russell King - ARM Linux admin
<linux@xxxxxxxxxxxxxxx> wrote:
>
> Under a 4.19 kernel (debian stable), I am surprised to find that some
> previously working i386 binaries no longer work, whereas others are
> fine. ls, for example, dies with a SEGV, but bash is fine.

Hmm. Is this with some recent stable kernel update? Or has it been
going on for a while and you only noticed now for some reason?

If it's recent, I'd be inclined to blame bbdc6076d2e5 ("binfmt_elf:
move brk out of mmap when doing direct loader exec") which afaik made
it into 4.19.75 and might be in that debian-stable.

And if it's that, then I think that it should be fixed by 7be3cb019db1
("binfmt_elf: Do not move brk for INTERP-less ET_EXEC") which is in
the current queue.

Adding Kees to the cc, in case he goes "No, silly Linus, you're being
stupid", or can confirm that yeah, that was the behavior for the
problem case.

Kees, original report with more information at

https://lore.kernel.org/lkml/20191005233227.GB25745@xxxxxxxxxxxxxxxxxxxxx/

And if that isn't the case, maybe you can send over one of the broken
binaries in private email for testing?

Linus