This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [PR target/83641] Fix incorrect CFI for stack clash protected noreturn function on x86/x86_64


On 01/02/2018 03:05 PM, Florian Weimer wrote:
> On 01/02/2018 09:02 PM, Jeff Law wrote:
>>     * config/i386/i386.c (ix86_adjut_stack_and_probe_stack_clash): Do not
> 
> Typo: “adjut”.
> 
>>     explicitly probe *sp in a noreturn function if there were any callee
>>     register saves.
> 
> I recompiled glibc with this patch, and I can confirm it fixes the new
> glibc test:
> 
>   https://sourceware.org/ml/libc-alpha/2017-12/msg00987.html
> 
> However, I would appreciate if it were possible to avoid emitting the
> .cfi_offset/.cfi_register annotations and only record the change of
> frame address.  The other CFI notes aren't needed, and it would avoid
> reintroducing this bug if the way the prologue is constructed changes
> and the condition for emitting the probe is not completely correct anymore.
I'm not aware of a way to do that.  I'm not even sure having the ability
to tell the CFI machinery to avoid that stuff is a good idea from a
design/implementation standpoint.

What we could do is beef up the testsuite checks to verify there are no
cfi restores and possibly add some asserts in the CFI machinery to
verify they do not emit a .cfi_restore in a noreturn function.  The
former it obviously trivial -- the latter may have fallout I'm not aware
of, particularly since I know very little about the CFI bits.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]