[Bug middle-end/81400] Stack smashing not caught by stack protector strong and allowing me to stack smash
marxin at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Aug 1 08:32:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81400
--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Alexander Monakov from comment #6)
> TLS canary is initialized by the libc; in Glibc sources you can grep for
> THREAD_STACK_SET_GUARD.
>
> In this example the leftmost byte of the SSP canary is overwritten by a
> zero. This does not change the canary because Glibc deliberately zeroes that
> leftmost byte (presumably, to harden against information-leak attacks when a
> string function like strcpy can be used to copy the canary value in an
> attacker-controlled manner):
>
> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/dl-
> osinfo.h;h=823cd8224df939134018fbd8f0227e9f501393ab;hb=HEAD#l63
>
> So what is the GCC bug here? What do we want to change?
Thank you Alexander for explanation. Making the last byte '\0' makes sense.
Thus we need to only fix the second issue with missing -lssp and the PR will be
fix.
Patch has been already sent to ML.
More information about the Gcc-bugs
mailing list