GCC 4.4.2 SSP and uClibc

Mwanguhya Daniel Murungi dmurungi at dicts.mak.ac.ug
Fri Nov 27 00:58:47 PST 2009


Hello,

Don't know what problem ur facing exactly but I now have a working system
using the SSP from uClibc (0.9.30.1) and GCC (4.2.4). 

The issue is to do with how GCC handles SSP on TLS and non TLS systems.

Attached is the patch I used to get it working. It's by Natanel Copa from 
Alpine Linux. Only problem is Robert's FORTIFY_SOURCE patch generates an 
internal compiler error during the build. 

I remember u were also interested in Linux PAM on uClibc; am using version 
Linux-PAM-1.0.4 and all is well. I can share the patches if ur still 
interested.

Daniel

On Thursday 26 November 2009 06:45:16 Kevin Day wrote:
> I am trying to figure out where the problem I have is, if it is some
> unusual bug as a result of my own deviations, a bug in uClibc and not
> glibc, or a bug with GCC.
>
> I am using GCC's libssp for SSP.
>
> There is an old upstream bug report of the same exact problem:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38274
>
> I would get an Illegal Instruction and a core dump with any
> appropriate SSP test at:
> http://www.linuxfromscratch.org/hlfs/view/unstable/glibc-2.6/chapter06/butt
>erfly-toolchain.html
>
> I ended up identifying that the problem exists somewhere with the exit
> process after a stack smash happens and is handled.
> I experimentally decided to take the ssp exit code directly from
> uClibc-0.9.28.3.
>
> Replacing the exit code and exiting with SIGKILL, the program now
> reports the Stack Smashing and exits without crashing and core
> dumping.
> Interestingly, if I used SIGABRT with the uClibc code, the program
> would crash and core dump.
>
> My system for the test case is uClibc-0.9.28.3 based with gcc-4.4.2
> and binutils-2.20.
>
> I do not remember seeing this problem way back whenever I was using
> the book's GCC and Binutils.
> The book specifies gcc-4.1.2 and binutils 2.17, so I assume this
> combination properly aborts with crashing?
>
>
> Has anybody on this list tried gcc-4.4.2 with SSP either under glibc or
> uClibc?
>
>
> Does this segfault happen when uClibc's internal ssp is used instead
> of the GCC libssp?
>
>
> --
> Kevin Day

-- 
Mwanguhya Daniel Murungi
Makerere University [ DICTS ]
P.O.Box 7062, Wandegeya
Kampala
Uganda

MYTH: Knowledge is power
TRUTH: APPLIED Knowledge is power
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc4-stack-protector-uclibc-no_tls.patch
Type: text/x-diff
Size: 3621 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/hlfs-dev/attachments/20091127/b10ce1a8/attachment.patch>


More information about the hlfs-dev mailing list