[PATCH 1/3] Add inhibit_stack_protector to ifuncmain9 [BZ #25680]
Siddhesh Poyarekar
siddhesh@sourceware.org
Sat Mar 13 06:07:50 GMT 2021
On 3/12/21 11:04 PM, Adhemerval Zanella via Libc-alpha wrote:
> Is it something preventing us to make x86 follows other architectures in this
> regard?
AFAICT, just more work to get it done :) There's also the general
hairiness of the whole sequence and historical issues with ifunc
interplay that doesn't add much confidence to any fix that may come in
this place. But that shouldn't prevent us from trying I guess.
> Not sure if adding exceptions for specific cases is the best approach,
> the users would expect that such mitigations to work regardless of
> compilation/linking model (although some do require extra linker/runtime
> support). My take is if we could fix on glibc we should aim for it.
I'm kinda on the fence, but will likely hop on to your side if I figure
out a fix.
>> It's not the glibc build that's affected though, at least not to an extent that we ought to care. What's broken is our support with binaries that were built with stack-protector-all *and* ifuncs. This patch implies that we don't support it; all we need to do is document this somewhere and perhaps fix gcc to never emit the prologue/epilogue for ifunc resolvers.
>
> Yeah, I understood that and my concern is if users do start to use
> ifunc more profusely they will need to keep adding the
> inhibit_stack_protector on resolvers to work around this issue.
>
> Fixing the ifunc resolution order also might simplify the code
> and avoid adding the inhibit_stack_protector on multiples files.
This is probably more work than I had bargained for, so I'm going to put
it back in the interest of looking at the more urgent problems (e.g. the
tunables breakage). I'll pick it up again later. In the meantime,
would you object to me pushing 2/3 and 3/3? 2/3 disables stack
protector on an early startup routine (I'll remove the
inhibit_stack_protector in the test so that we can fix it alongside 1/3)
and 3/3 is the SHARED cleanup that I had posted when you noticed these
test failures. The cleanup doesn't cause these failures and seems safe.
Siddhesh
More information about the Libc-alpha
mailing list