Re: Fwd: Segfaulting with Ubuntu

Ingo Struck <[email protected]>
Newsgroups gmane.linux.lib.dietlibc
Message-ID <[email protected]>
On Friday 05 February 2010 18:43:30 Felix von Leitner wrote:
> > That worked!  What exactly causes this issue? Certainly not a buffer
> > overflow in dietlibc?
>
> I added a workaround to the Makefile.
>
> The issue is this: Ubuntu adds -fstack-protector to the gcc default
> flags, without telling anyone.

They tell you within the ubuntu-adapted version of the man page:

ingo@neo:~$ uname -a
Linux neo 2.6.24-26-server #1 SMP Tue Dec 1 18:26:43 UTC 2009 x86_64 GNU/Linux
ingo@neo:~$ man gcc | grep -A12 -- "-fstack-protector$"
       -fstack-protector
           Emit extra code to check for buffer overflows, such as stack smash‐
           ing attacks.  This is done by adding a guard variable to functions
           with vulnerable objects.  This includes functions that call alloca,
           and functions with buffers larger than 8 bytes.  The guards are
           initialized when a function is entered and then checked when the
           function exits.  If a guard check fails, an error message is
           printed and the program exits.

           NOTE: In Ubuntu 6.10 and later versions this option is enabled by
           default for C, C++, ObjC, ObjC++, if neither -fno-stack-protector
           nor -nostdlib are found.


However, they deserve a kick for turning on any option at all 
that is not the default for a vanilla gcc build...

Regards

Ingo Struck
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.