Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 395609 - sys-devel/gcc-4.5.3-r2 is aware but does not honor libssp USE flag, breaking glibc upgrades
Summary: sys-devel/gcc-4.5.3-r2 is aware but does not honor libssp USE flag, breaking ...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-21 22:56 UTC by Larry
Modified: 2016-01-12 18:54 UTC (History)
1 user (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 Larry 2011-12-21 22:56:37 UTC
# nm -AD /usr/bin/x86_64-pc-linux-gnu-* | grep guard
/usr/bin/x86_64-pc-linux-gnu-c++:                 U __guard
/usr/bin/x86_64-pc-linux-gnu-cpp:                 U __guard
/usr/bin/x86_64-pc-linux-gnu-g++:                 U __guard
/usr/bin/x86_64-pc-linux-gnu-gcc:                 U __guard
/usr/bin/x86_64-pc-linux-gnu-gcj:                 U __guard
/usr/bin/x86_64-pc-linux-gnu-gcjh:                 U __guard
/usr/bin/x86_64-pc-linux-gnu-ld.gold:                 U __cxa_guard_abort
/usr/bin/x86_64-pc-linux-gnu-ld.gold:                 U __cxa_guard_acquire
/usr/bin/x86_64-pc-linux-gnu-ld.gold:                 U __cxa_guard_release


Reproducible: Always

Steps to Reproduce:
1. emerge sys-devel/gcc-4.5.3-r2
2. set active gcc to 4.5.3-r2 with gcc-config
2. attempt to emerge sys-libs/glibc-2.13-r4
3. glibc will fail complaining about __guard symbols *in gcc 4.5.3-r2 which has libssp disabled/built without the flag*
Actual Results:  
# emerge -a --verbose gcc
[ebuild   R   ~] sys-devel/gcc-4.5.3-r2  USE="cxx gcj hardened mudflap (multilib) nls nptl openmp (-altivec) -bootstrap -build -doc (-fixed-point) -fortran -graphite -gtk (-libffi) (-libssp) -lto -multislot -nocxx -nopie -nossp -objc -objc++ -objc-gc -test -vanilla" 0 kB

(works, note libssp is *DISABLED*)

 * Messages for package sys-libs/glibc-2.13-r4:
 * Your system still has old SSP __guard symbols.  You need to
 * rebuild all the packages that provide these files first:
 * //lib64/cpp
 * //usr/bin/c++
 * //usr/bin/cc
 * //usr/bin/gcjh
 * //usr/bin/x86_64-pc-linux-gnu-gcc
 * //usr/bin/cpp
 * //usr/bin/gcj
 * //usr/bin/x86_64-pc-linux-gnu-gcj
 * //usr/bin/gcov
 * //usr/bin/g++
 * //usr/bin/gcc
 * //usr/bin/x86_64-pc-linux-gnu-gcjh
 * //usr/bin/x86_64-pc-linux-gnu-cpp
 * //usr/bin/x86_64-pc-linux-gnu-c++
 * //usr/bin/x86_64-pc-linux-gnu-g++
 * //usr/lib64/libltdl.so.3

There's a possibility things might cause major breakage. gcc-4.5.3-r2 clearly has a problem honoring the libssp flag (which it is aware of...). This blocks upgrading glibc.

sys-devel/gcc-4.5.3-r2 needs downgrading to previous version in order to be able to upgarde glibc. it is unclear if doing so will actually leave ebuilds emerged with sys-devel/gcc-4.5.3-r2 in a broken state.

Expected Results:  
sys-libs/glibc-2.13-r4 emerges correctly and gcc-4.5.3-r2 honors libssp flag (so when it is *disabled* __guard isnt built as part of the built-in libssp).

Portage 2.1.10.41 (hardened/linux/amd64, gcc-4.5.3, glibc-2.12.2-r0, 3.0.4-grsec-subreption x86_64)
=================================================================
System uname: Linux-3.0.4-grsec-subreption-x86_64-Intel-R-_Xeon-R-_CPU_X3210_@_2.13GHz-with-gentoo-2.0.3
Timestamp of tree: Tue, 20 Dec 2011 20:45:01 +0000
ccache version 3.1.6 [enabled]
app-shells/bash:          4.1_p9
dev-java/java-config:     1.3.7-r1, 2.1.11-r3
dev-lang/python:          2.6.7-r2, 2.7.2-r3, 3.1.4-r3, 3.2.2
dev-util/ccache:          3.1.6
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.65-r1
sys-devel/automake:       1.5, 1.7.9-r1, 1.9.6-r2, 1.10.3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            3.4.6-r2, 4.3.6-r1, 4.4.6-r1, 4.5.3-r2
sys-devel/gcc-config:     1.4.1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=nocona -fforce-addr"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=nocona -fforce-addr"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs ccache distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ "
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
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=""
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="acl amd64 animgif apache2 bash-completion berkdb bzip2 clamav cli cracklib crypt cscope cups curl cxx dri enscript fastcgi gdbm gif git gmp gnutls gpg gpm graphviz hardened havekernel iconv imap imlib ipv6 java jpeg justify libwww maildir mailwrapper mbox mem-scramble memlimit mhash mktemp mmx modules mudflap multilib mysql mysqli ncurses nls nptl nptlonly ogg openmp openssl pam pax_kernel pcntl pcre perl php png pop postfix pppd python razor readline rrdtool rss ruby ruby19 sasl session smtp sockets socks5 spamassassin spf sqlite3 sse sse2 ssl subversion svg sysfs tcpd threads tidy tiff tls truetype unicode urandom vhosts vim-syntax vorbis webdav xattr xinetd xml xmlrpc xorg xpm 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 auth_digest cgi log_forensic proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Larry 2011-12-22 02:24:35 UTC
After rebuilding gcc (4.5.3-r1 this time) the problem persists:

 * Your system still has old SSP __guard symbols.  You need to
 * rebuild all the packages that provide these files first:
 * //lib64/cpp
 * //usr/bin/c++
 * //usr/bin/cc
 * //usr/bin/gcjh
 * //usr/bin/x86_64-pc-linux-gnu-gcc
 * //usr/bin/cpp
 * //usr/bin/gcj
 * //usr/bin/x86_64-pc-linux-gnu-gcj
 * //usr/bin/gcov
 * //usr/bin/g++
 * //usr/bin/gcc
 * //usr/bin/x86_64-pc-linux-gnu-gcjh
 * //usr/bin/x86_64-pc-linux-gnu-cpp
 * //usr/bin/x86_64-pc-linux-gnu-c++
 * //usr/bin/x86_64-pc-linux-gnu-g++
 * //usr/lib64/libltdl.so.3
 * ERROR: sys-libs/glibc-2.13-r4 failed (setup phase):
 *   old __guard detected

Reverting to 4.4.6 causes things like eix to break, and does not resolve the issue. It also contains guard symbols.
Comment 2 Kevin Pyle 2012-01-30 01:11:12 UTC
/usr/bin/gcc and friends are not owned by sys-devel/gcc (any version).  Instead, they are copies of /usr/lib64/misc/gcc-config, which is owned by sys-devel/gcc-config.  This is a consequence of allowing users to switch the active gcc version cheaply: a binary aware of gcc-config choices must be invoked first, then chain to the real gcc.

Rebuild sys-devel/gcc-config, reset your active gcc version, then repeat your test.

The problem with libltdl.so.3 is probably a side effect of @preserved-rebuild.  Verify that you have libltdl.so.7 (or newer), that you have nothing depending on that old version, then delete the old version.
Comment 3 SpanKY gentoo-dev 2016-01-12 18:54:42 UTC
libssp has never been supported

latest hardened systems use native upstream ssp logic