[PATCH] tst-setcontext10.c: Undef _FORTIFY_SOURCE
Siddhesh Poyarekar
siddhesh@gotplt.org
Tue Dec 19 21:22:59 GMT 2023
On 2023-12-19 13:02, H.J. Lu wrote:
> 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.
I don't remember the details, but ____longjmp_chk seemed to be a source
for false positives, enough for packages (ceph and python-cysignal IIRC)
to disable fortification altogether as a result.
If this check is not reliable enough (I haven't had time to check) then
does it make sense to disable it altogether until we can make this check
more reliable?
Thanks,
Sid
More information about the Libc-alpha
mailing list