DragonFly users List (threaded) for 2008-04
DragonFly BSD
DragonFly users List (threaded) for 2008-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Stack protector broken in gcc41?


From: Hasso Tepper <hasso@xxxxxxxxx>
Date: Tue, 15 Apr 2008 09:52:34 +0300

Matthew Dillon wrote:
> :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

Yeah, but should we take care of preserving symbols for old stuff as well? 
We would break binaries compiled with gcc34 otherwise?


-- 
Hasso Tepper



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]