Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 285956 - hardened-dev overlay: SSP error in libstdc++
Summary: hardened-dev overlay: SSP error in libstdc++
Status: RESOLVED FIXED
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-09-22 14:13 UTC by Milan Holzäpfel
Modified: 2010-03-21 13:57 UTC (History)
3 users (show)

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 Milan Holzäpfel 2009-09-22 14:13:22 UTC
I think the patch from https://hardened.gentooexperimental.org/trac/secure/changeset/0c0259995cd7ee7c618b88c61286ad344e2e5a58 should be re-added to libstdc++ in the hardened-dev overlay. 

I'm using the hardened-dev overlay, and after the fix added in https://hardened.gentooexperimental.org/trac/secure/ticket/78 , libstdc++ now stops building with an stack smashing error in xgcc, like repoted in https://hardened.gentooexperimental.org/trac/secure/ticket/64 . 

I haven't been able to test whether this actually fixes the problem, but I will report as soon as I have tested it. 

Reproducible: Always




Latest commit in my hardened-development overlay was 80de450f9ff3eee9d3af064efa8d20eba18b3723

# emerge --info
Portage 2.1.6.13 (hardened/linux/amd64/10.0, gcc-4.3.4, glibc-2.9_p20081201-r4, 2.6.30.4-9nfs x86_64)
=================================================================
System uname: Linux-2.6.30.4-9nfs-x86_64-AMD_Athlon-tm-_X2_Dual_Core_Processor_BE-2400-with-gentoo-1.12.11.1
Timestamp of tree: Tue, 22 Sep 2009 02:15:01 +0000
app-shells/bash:     4.0_p28
dev-lang/python:     2.6.2-r1
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -march=x86-64 -mtune=k8 -Os"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-pipe -march=x86-64 -mtune=k8 -Os"
DISTDIR="/usr/src/pkg"
EMERGE_DEFAULT_OPTS="--nospinner -j1 --with-bdeps y"
FEATURES="buildpkg collision-protect distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS=" ftp://ftp.ipv6.uni-muenster.de/pub/linux/distributions/gentoo ftp://ftp6.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp6.uni-muenster.de/pub/linux/distributions/gentoo ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.heanet.ie/pub/gentoo/ ftp://ftp.snt.ipv6.utwente.nl/pub/os/linux/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/ http://mirror.uni-c.dk/pub/gentoo/ ftp://trumpetti.atm.tut.fi/gentoo/"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--warn-once -Wl,--hash-style=gnu"
LINGUAS="de en en_GB fr es"
MAKEOPTS="-j3"
PKGDIR="/usr/portage-pkg"
PORTAGE_CONFIGROOT="/"
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"
PORTDIR_OVERLAY="/usr/portage/local/mh /usr/local/portage/layman/hardened-development /usr/local/toolchain-overlay"
SYNC="rsync://rsync.gentoo.greent.eu/gentoo-portage"
USE="amd64 apache2 bash-completion berkdb bzip2 clamav cli cracklib crypt daemon doc dovecot-sasl dri dspam epydoc examples fastcgi gdbm git gpm hardened iconv iproute2 ipv6 isdnlog jadetex jpeg justify logrotate logwatch lzo mailwrapper milter mimencode mmx modules mudflap multilib mysql ncurses normalizemime nptl nptlonly pam pam_chroot pcre perl pic pkcs11 png postfix pppd python readline reflection session sieve spl sse sse2 ssl subversion suexec svg sysfs syslog tcl tcpd threads tiff tools truetype unicode urandom user-homedirs userlocales vim-syntax virtual-users web webdav xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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 auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de en en_GB fr es" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Magnus Granberg gentoo-dev 2009-09-27 14:33:53 UTC
Should have be fixed in the  eclass/flag-o-matic.eclass _filter-hardened()
Will look at it.
Comment 2 Anthony Basile gentoo-dev 2009-09-27 15:50:22 UTC
I tested this with the compilers from the overlay.  I confirmed the bug for 4.3.4-r1.  However, libstdc++ compiles fine for 4.4.1-r1.  My emerge --info is in the next comment.
Comment 3 Anthony Basile gentoo-dev 2009-09-27 15:50:41 UTC
Portage 2.1.6.13 (hardened/linux/amd64/10.0, gcc-4.4.1, glibc-2.9_p20081201-r4, 2.6.28-hardened-r9 x86_64)
=================================================================
System uname: Linux-2.6.28-hardened-r9-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-1.12.11.1
Timestamp of tree: Sat, 26 Sep 2009 06:00:01 +0000
app-shells/bash:     4.0_p28
dev-lang/python:     2.6.2-r1
dev-util/cmake:      2.6.4
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://67.151.215.230/pub/gentoo"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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"
PORTDIR_OVERLAY="/usr/local/portage/layman/hardened-development"
SYNC="rsync://67.151.215.228/gentoo-portage"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cups dri gdbm gpm hardened iconv isdnlog justify mmx modules mudflap multilib ncurses nptl nptlonly pam pcre perl pic pppd python readline reflection session spl sse sse2 ssl sysfs tcpd urandom xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident 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
Comment 4 Magnus Granberg gentoo-dev 2009-10-03 20:28:44 UTC
Commit	86d6cc741aba959b2c07fa11ce83cbcf42fbdf1e
Thanks all
Working on a new libstdc++-v3 see bug 231870
Comment 5 Xake 2010-01-25 14:41:03 UTC
Still broken or closing time?
Comment 6 Anthony Basile gentoo-dev 2010-02-02 02:24:33 UTC
I retested libstdc++-v3-3.3.6 against the overlay gcc-4.3.4, 4.4.1 and 4.4.2.  Only 4.3.4 fails without compile_with_no-SSP.patch.  So the ebuild should only apply the patch for gcc-major-version = 4 and gcc-minor-version = 3.

The current ebuild has:

	# bug 285956 Fail on GCC 4.3.3 but pass on GCC 4.4.1
	if [[ get-version > 4.2 ]] ; then
		epatch "$FILESDIR"/compile_with_no-SSP.patch
	fi

however, I don't think get-version works.  The if line should read:

	if [[ "$(gcc-major-version)" = "4" ]] && [[ "$(gcc-minor-version)" = "3" ]] ; then


Also, with the recent removal of libstdc++-v3-4.4.1.ebuild and libstdc++-v3-4.4.2.ebuild, we don't need libstdc++-v3-Makefile.in.patch in ${FILESDIR}.

All of this has been tested on x86_64 and the resulting /usr/lib64/libstdc++.so.5.0.7 works when linked against.

I'm testing now on i686.  If there are no objections, I'll commit these changes to the overlay.

	
Comment 7 Anthony Basile gentoo-dev 2010-02-02 03:22:25 UTC
I tested the changes in Comment #6 on i686 as well, and it looks good.
Comment 8 Magnus Granberg gentoo-dev 2010-03-21 13:57:46 UTC
Committed to the overlay and works fine.