Stack protector broken in gcc41?

Matthew Dillon dillon at apollo.backplane.com
Mon Apr 14 15:21:34 PDT 2008


:
:Even hello world fails to link:
:
:~$ gcc -fstack-protector-all -o hello-world hello-world.c
:/tmp//cckehwVf.o: In function `main':
:hello-world.c:(.text+0x12): undefined reference to `__stack_chk_guard'
:hello-world.c:(.text+0x35): undefined reference to `__stack_chk_guard'
:hello-world.c:(.text+0x3c): undefined reference to `__stack_chk_fail'
:~$
:
:-- 
:Hasso Tepper

    They must have changed the symbols.  libc only has the 
    __stack_smash_handler symbol (which is what the original stack
    protector code needed).

    It sounds like the new symbols and supporting code will have to be
    added to libc.

    FreeBSD seems to have an implementation, though they are using a
    sysctl to get the random seed.  A little surgery to replace
    that with our /dev/urandom code and we'd be golden:

    leaf:/archive/FreeBSD-current/src/lib/libc/sys/stack_protector.c

					-Matt
					Matthew Dillon 
					<dillon at backplane.com>





More information about the Users mailing list