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)



The following reply was made to PR toolchain/52675; it has been noted by GNATS.

From: Rin Okuyama <rokuyama.rk%gmail.com@localhost>
To: Martin Husemann <martin%duskware.de@localhost>
Cc: "gnats-bugs%NetBSD.org@localhost" <gnats-bugs%netbsd.org@localhost>, netbsd-bugs%netbsd.org@localhost
Subject: Re: toolchain/52675 (crunching binaries improperly removes PaX notes)
Date: Thu, 15 Jun 2023 09:55:09 +0900

 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