NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/52675 (crunching binaries improperly removes PaX notes)



Sorry for the delayed response!

On 2023/06/05 18:16, Martin Husemann wrote:
On Mon, Jun 05, 2023 at 05:41:55PM +0900, Rin Okuyama wrote:
For crunchgen(1), clear PaX flags instead of removing its section.
Otherwise, a zero-filled hole appears in ELF note segment for arm,
for which MARCH note is located after PaX one.

I still wonder if this should be considered a binutils bug (worth
reporting upstream?)

Well, a candidate fix is:

(1) If the removed section is located the top or bottom of a segment,
    shrink that segment (as already done).
(2) Otherwise, split the segment:
(3) Insert a new program header.
(4) Relocate a payload backward.
(5) Adjust {p,sh}_offset and friends appropriately.

This should be technically possible. But given this has been left
untouched during the last three decades, they may be not interested...

For this purpose, introduce -0 option for paxctl(8) to zero-clear
PaX flags. IMO, this should be clearer than disabling all available
flags.

I like this idea and the patch looks good to me.

Thanks for your comment! I will commit soon.

Thanks,
rin


Home | Main Index | Thread Index | Old Index