[PATCH] tst-setcontext10.c: Undef _FORTIFY_SOURCE

Florian Weimer fweimer@redhat.com
Tue Dec 19 20:28:55 GMT 2023


* H. J. Lu:

> When _FORTIFY_SOURCE is defined to 2, ____longjmp_chk is called,
> instead of longjmp.  ____longjmp_chk compares the relative stack
> values to decide if it is called from a stack frame which called
> setjmp.  If not, ____longjmp_chk assumes that an alternate signal
> stack is used.  Since comparing the relative stack values isn't
> reliable with user context, when there is no signal, ____longjmp_chk
> will fail.  Undefine _FORTIFY_SOURCE to avoid ____longjmp_chk in
> user context test.

Doesn't shadow stack longjmp unwind the shadow stack and provides better
checking than ____longjmp_chk, that is, should we call shadow stack
longjmp from ____longjmp_chk (or select it via an IFUNC)?

Thanks,
Florian



More information about the Libc-alpha mailing list