Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 257897 - gcc-4.3.3 - fstack-protector not default
Summary: gcc-4.3.3 - fstack-protector not default
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-06 14:00 UTC by barthek
Modified: 2009-02-13 09:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description barthek 2009-02-06 14:00:20 UTC
hi,

i'm used to having apps compiled with -fstack-protector as default options (this is true with gcc-3.4.6 with 'hardened' USE flag).

with gcc-4.3.3 however, even though it has been compiled with 'hardened', stack protector is not enabled by default.

is this a change by design or some omission?

emerge info
System uname: Linux-2.6.27-hardened-i686-Pentium_III_-Katmai-with-glibc2.1.3
Timestamp of tree: Fri, 06 Feb 2009 04:45:01 +0000
app-shells/bash:     3.2_p48
dev-lang/python:     2.4.4-r4, 2.5.4-r2
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.2
sys-apps/sandbox:    1.3.2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=pentium3 -O2 -pipe"
DISTDIR="/opt/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS=""
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync4.pl.gentoo.org/gentoo-portage"
USE="bashlogger berkdb bitmap-fonts bzip2 caps chroot cracklib crypt ftp glibc-omitfp hardened hpn jpeg midi mmx ncurses nptl nptlonly pam pam_chroot pam_timestamp pic png pthreads readline slang sse ssl symlink tcpd threads urandom userlocales x86 xinetd xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1    emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m       maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="mouse keyboard evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt intel   mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage  siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware  voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 solar (RETIRED) gentoo-dev 2009-02-12 21:56:29 UTC
This is known and not a bug at this time. The gcc:4 hardened support does not include ssp at this time. It will most likely include ssp before being marked stable for hardened. 
Comment 2 barthek 2009-02-13 09:30:28 UTC
hi solar,
just wanted to clear sth up - 

in the gcc ive emerged (hardened) the stack protector is implemented, its just not enabled by default.

x@x ~/src $ gcc -o exp exp.c
x@x ~/src $ ./exp
hehe
Killed

(this is where pax kicks in)

x@x ~/src $ gcc -fstack-protector -o exp exp.c
x@x ~/src $ ./exp
hehe
*** stack smashing detected ***: exp - terminated
exp: stack smashing attack in function <unknown> - terminated
Report to http://bugs.gentoo.org/
Killed

x@x ~/src $ gcc -v
Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/4.3.3/specs
Target: i686-pc-linux-gnu
Configured with: /home/portagetmp/portage/sys-devel/gcc-4.3.3/work/gcc-4.3.3/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.3.3 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-fixed-point --disable-nls --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --disable-libmudflap --disable-libssp --disable-libgomp --enable-cld --disable-libgcj --with-arch=i686 --enable-languages=c,c++,treelang --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.3 p1.0, pie-10.1.5'
Thread model: posix
gcc version 4.3.3 (Gentoo 4.3.3 p1.0, pie-10.1.5)