Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 135932 - Stack smashing attack in function ix86_split_to_parts
Summary: Stack smashing attack in function ix86_split_to_parts
Status: RESOLVED DUPLICATE of bug 78618
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-07 08:21 UTC by erics-junk
Modified: 2006-09-22 02: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 erics-junk 2006-06-07 08:21:22 UTC
Portage 2.0.54-r2 (hardened/x86/2.6, gcc-3.4.4, glibc-2.3.5-r2, 2.6.11-gentoo-r3 i686)
=================================================================
System uname: 2.6.11-gentoo-r3 i686 Intel(R) Pentium(R) 4 CPU 1400MHz
Gentoo Base System version 1.6.14
dev-lang/python:     2.4.2
dev-python/pycrypto: [Not Present]
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  [Not Present]
sys-devel/automake:  [Not Present]
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   [Not Present]
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -02 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -02 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage//packages/x86/"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage/"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl bzip2 crypt dga dhcp dlloader esd hardened lm_sensors mmx mmx2 ncurses nls pam perl pic python readline sse2 ssl tcltk
tcpd tiff usb userlocales x86 xorg zlib userland_GNU kernel_linux elibc_glibc"
Unset:  CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS, PORTDIR_OVERLAY





I receive this build error during a stage 1 bootstrap for hardened x86:

/var/tmp/portage/gcc-3.4.6-r1/work/build/gcc/xgcc -B/var/tmp/portage/gcc-3.4.6-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include -c -DHAVE_CONFIG_H -O2 -march=pentium4 -pipe -I. -I/var/tmp/portage/gcc-3.4.6-r1/work/gcc-3.4.6/libiberty/../include  -W -Wall -Wtraditional -pedantic -fpic /var/tmp/portage/gcc-3.4.6-r1/work/gcc-3.4.6/libiberty/floatformat.c -o pic/floatformat.o; \
else true; fi
cc1: stack smashing attack in function ix86_split_to_parts()
{standard input}: Assembler messages:
{standard input}:0: Warning: end of file not at end of a line; newline inserted
{standard input}:422: Error: suffix or operands invalid for `cmp'
xgcc: Internal error: Aborted (program cc1)
Please submit a full bug report.
See <URL:http://bugs.gentoo.org/> for instructions.
make[2]: *** [floatformat.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/gcc-3.4.6-r1/work/build/i686-pc-linux-gnu/libiberty'
make[1]: *** [all-target-libiberty] Error 2
make[1]: Leaving directory `/var/tmp/portage/gcc-3.4.6-r1/work/build'
make: *** [profiledbootstrap] Error 2

!!! ERROR: sys-devel/gcc-3.4.6-r1 failed.
!!! Function gcc_do_make, Line 1334, Exitcode 2
!!! emake failed with profiledbootstrap 

It is reproducible, I tried an emerge --sync 2 days later and had the same result. I realize stage1 installs are no longer supported, but I believe the same would happen if I did an emerge -uD
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-09-22 01:13:36 UTC

*** This bug has been marked as a duplicate of 78618 ***
Comment 2 Lukasz Zielinski 2006-09-22 02:30:05 UTC
Hej,
I have reproduced the problem again. See below:

t433 ~ # uname -a
Linux t433 2.6.12.4 #2 Wed Aug 10 12:16:00 CEST 2005 i686 Intel(R) Celeron(R) CPU 2.53GHz GNU/Linux
t433 ~ # emerge --oneshot --update --newuse --ask gcc

These are the packages that would be merged, in order:

Calculating dependencies

Exiting on signal 2

t433 ~ # uname -a
Linux t433 2.6.12.4 #2 Wed Aug 10 12:16:00 CEST 2005 i686 Intel(R) Celeron(R) CPU 2.53GHz GNU/Linux
t433 ~ # emerge --info
Portage 2.1.1 (default-linux/x86/2006.1, gcc-3.4.6, glibc-2.3.6-r4, 2.6.12.4 i686)
=================================================================
System uname: 2.6.12.4 i686 Intel(R) Celeron(R) CPU 2.53GHz
Gentoo Base System version 1.12.5
Last Sync: Fri, 22 Sep 2006 08:30:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: [Not Present]
dev-lang/python:     2.3.5-r2, 2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="rsync://mirrors.sec.informatik.tu-darmstadt.de/gentoo/"
LINGUAS=""
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="apache2 apm bash-completion berkdb cdb cli crypt cups dlloader dri elibc_glibc encode f77 foomaticdb fortran gdbm gif imap imlib input_devices_evdev input_devices_keyboard input_devices_mouse isdnlog jpeg kernel_linux libwww maildir mysql ncurses nptl nptlonly pam pcre pdflib perl png ppds pppd python readline reflection sasl session spl ssl tcpd truetype-fonts type1-fonts udev unicode userland_GNU video_cards_apm video_cards_ark video_cards_ati video_cards_chips video_cards_cirrus video_cards_cyrix video_cards_dummy video_cards_fbdev video_cards_glint video_cards_i128 video_cards_i740 video_cards_i810 video_cards_imstt video_cards_mga video_cards_neomagic video_cards_nsc video_cards_nv video_cards_rendition video_cards_s3 video_cards_s3virge video_cards_savage video_cards_siliconmotion video_cards_sis video_cards_sisusb video_cards_tdfx video_cards_tga video_cards_trident video_cards_tseng video_cards_v4l video_cards_vesa video_cards_vga video_cards_via video_cards_vmware video_cards_voodoo x86 xml2 xorg zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS

t433 ~ # emerge --oneshot --update --newuse --ask gcc

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  NS   ] sys-devel/gcc-4.1.1  USE="fortran (-altivec) -bootstrap -build -doc -gcj -gtk (-hardened) -ip28 -ip32r10k -mudflap (-multilib) -multislot (-n32) (-n64) -nls -nocxx -objc -objc++ -objc-gc -test -vanilla"
[ebuild     U ] sys-libs/glibc-2.4-r3 [2.3.6-r4] USE="nptl* nptlonly* -hardened*"

Would you like to merge these packages? [Yes/No] y

>>> Emerging (1 of 2) sys-devel/gcc-4.1.1 to /

[...]

stage1/xgcc -Bstage1/ -B/usr/i686-pc-linux-gnu/bin/ -c   -march=prescott -O2 -pipe -fprofile-generate -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute     -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc/. -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc/../include -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc/../libcpp/include     /var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc/gcse.c -o gcse.o
stage1/xgcc -Bstage1/ -B/usr/i686-pc-linux-gnu/bin/ -c   -march=prescott -O2 -pipe -fprofile-generate -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute     -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc/. -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc/../include -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc/../libcpp/include     genrtl.c -o genrtl.o
stage1/xgcc -Bstage1/ -B/usr/i686-pc-linux-gnu/bin/ -c   -march=prescott -O2 -pipe -fprofile-generate -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute     -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc/. -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc/../include -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc/../libcpp/include     /var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/gcc/ggc-common.c -o ggc-common.o
cc1: stack smashing attack in function ix86_split_to_parts()
xgcc: Internal error: Aborted (program cc1)
Please submit a full bug report.
See <URL:http://bugs.gentoo.org/> for instructions.
make[2]: *** [ggc-common.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/gcc-4.1.1/work/build/gcc'
make[1]: *** [stageprofile_build] Error 2
make[1]: Leaving directory `/var/tmp/portage/gcc-4.1.1/work/build/gcc'
make: *** [profiledbootstrap] Error 2

!!! ERROR: sys-devel/gcc-4.1.1 failed.
Call stack:
  ebuild.sh, line 1546:   Called dyn_compile
  ebuild.sh, line 937:   Called src_compile
  ebuild.sh, line 1255:   Called toolchain_src_compile
  toolchain.eclass, line 24:   Called gcc_src_compile
  toolchain.eclass, line 1534:   Called gcc_do_make
  toolchain.eclass, line 1408:   Called die

!!! emake failed with profiledbootstrap
!!! If you need support, post the topmost build error, and the call stack if relevant.

And again:
t433 ~ # gcc-config -c
 * gcc-config: No gcc profile is active!
t433 ~ # gcc-config -l
 [1] i386-pc-linux-gnu-3.4.6 *
 [2] i386-pc-linux-gnu-3.4.6-hardenednopie
 [3] i386-pc-linux-gnu-3.4.6-hardenednopiessp
 [4] i386-pc-linux-gnu-3.4.6-hardenednossp
 [5] i386-pc-linux-gnu-3.4.6-vanilla
t433 ~ # gcc-config 1
 * Switching cross-compiler to i386-pc-linux-gnu-3.4.6 ...
>>> Regenerating /etc/ld.so.cache...                                                                                                      [ ok ]
 * If you intend to use the gcc from the new profile in an already
 * running shell, please remember to do:

 *   # source /etc/profile

t433 ~ # source /etc/profile
t433 ~ # gcc-config -c
 * gcc-config: No gcc profile is active!