This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: V2: [PATCH 02/24] x86: Support shadow stack pointer in setjmp/longjmp
* H. J. Lu:
>> #undef. I think you can avoid that by using #if SHTSTK_ENABLED
>> instead of #ifdef SHADOW_STACK_POINTER_OFFSET, which also expresses
>> the intent more accurately.
>
> It is done on purpose. sysdeps/x86_64/__longjmp.S has
>
> /* Don't restore shadow stack register if
> 1. Shadow stack isn't enabled. Or
> 2. __longjmp is defined for __longjmp_cancel.
> */
> #if !SHSTK_ENABLED || defined __longjmp
> # undef SHADOW_STACK_POINTER_OFFSET
> #endif
It's a bit awkward.
> Subject: [PATCH] x86_64: Undef SHADOW_STACK_POINTER_OFFSET last
>
> Since SHADOW_STACK_POINTER_OFFSET is defined in jmp_buf-ssp.h, we must
> undef SHADOW_STACK_POINTER_OFFSET after including <jmp_buf-ssp.h>.
>
> * sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S: Undef
> SHADOW_STACK_POINTER_OFFSET after including <jmp_buf-ssp.h>.
This looks okay as a fix.