Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 144105 - openoffice-2.0.3 - stack smashing during build
Summary: openoffice-2.0.3 - stack smashing during build
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-16 04:44 UTC by Brant Gurganus
Modified: 2009-07-10 23:13 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 Brant Gurganus 2006-08-16 04:44:32 UTC
It appears that one of the tools used in building OpenOffice.org 2.0.3 overwrites its stack. Build message is as follows: If this is the type of crash that will core dump, I have ulimit -c unlimited set and will upload the stack trace produced from core dump if it appears useful.

register component 'javavm.uno.so' in registry '../../unxlngi6.pro/lib/uno_services.rdb' succesful!
regcomp -register  -br ../../unxlngi6.pro/misc/bridgetest/bootstrap.rdb -r ../../unxlngi6.pro/lib/uno_services.rdb -c \
        file:///var/tmp/portage/openoffice-2.0.3/work/ooo-build-2.0.3.0/build/OOO_2_0_3/testtools/source/bridgetest/../../unxlngi6.pro/class/testComponent.jar \        -env:URE_INTERNAL_JAVA_DIR=file:///var/tmp/portage/openoffice-2.0.3/work/ooo-build-2.0.3.0/build/OOO_2_0_3/solver/680/unxlngi6.pro/bin
using loader com.sun.star.loader.Java2
regcomp.bin: stack smashing attack in function void rtl_createUuid(sal_uInt8*, const sal_uInt8*, sal_Bool)()
Abort
dmake:  Error code 134, while making '../../unxlngi6.pro/lib/uno_services.rdb'
dmake:  '../../unxlngi6.pro/lib/uno_services.rdb' removed.
'---* tg_merge.mk *---'

ERROR: Error 65280 occurred while making /var/tmp/portage/openoffice-2.0.3/work/ooo-build-2.0.3.0/build/OOO_2_0_3/testtools/source/bridgetest
make: *** [stamp/build] Error 1
Comment 1 Matan Peled 2006-08-16 04:49:06 UTC
You have PaX installed, correct?
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-08-16 04:49:43 UTC
Also post your emerge --info when filing bugs.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2006-08-16 07:33:20 UTC
See above.
Comment 4 Brant Gurganus 2006-08-16 14:24:56 UTC
emerge --info:

Portage 2.1-r2 (default-linux/x86/2006.0, gcc-3.4.6, glibc-2.3.6-r4, 2.6.17-gentoo-r4 i686)
=================================================================
System uname: 2.6.17-gentoo-r4 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.20GHzGentoo Base System version 1.12.4
ccache version 2.3 [enabled]
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
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.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium4m -mtune=pentium4m -mfpmath=sse -ftracer -funroll-loops -fprefetch-loop-arrays -fstack-protector-all -maccumulate-outgoing-args -pipe -ggdb3"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O3 -march=pentium4m -mtune=pentium4m -mfpmath=sse -ftracer -funroll-loops -fprefetch-loop-arrays -fstack-protector-all -maccumulate-outgoing-args -pipe -ggdb3"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer parallel-fetch sandbox sfperms splitdebug strict test userfetch userpriv usersandbox"
GENTOO_MIRRORS="ftp://ftp.cs.rose-hulman.edu/linux/gentoo"
LDFLAGS="-Wl,-O1,--as-needed,--sort-common,--enable-new-dtags"
LINGUAS="en_US"
MAKEOPTS="-j"
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"
SYNC="rsync://gentoo.cs.rose-hulman.edu/gentoo-portage"
USE="x86 X Xaw3d a52 aac acl acpi afs alsa avi bash-completion berkdb bitmap-fonts bzip2 cdr cjk cli crypt cups dbus dga dlloader dri dts dvd eds emacs emboss encode esd evo firefox flac foomaticdb gd gdbm gif gnome gpm graphviz gstreamer gtk gtk2 hal idn imagemagick imlib isdnlog java jbig jpeg jpeg2k kerberos lcms ldap libg++ libwww mad mikmod mmap mmx mng mono motif mozilla mp3 mpeg ncurses nls nptl nsplugin ogg opengl pam pcmcia pcre pdf pdflib perl png ppds pppd python quicktime readline reflection samba session slp speex spell spl sse ssl svg symlink tcpd test theora threads tiff truetype truetype-fonts type1-fonts udev unicode usb vorbis win32codecs wmf xine xml xorg xpm xprint xv xvid zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux linguas_en_US userland_GNU video_cards_radeon"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

PaX is not installed (at least not by me).
Comment 5 Brant Gurganus 2006-08-16 14:36:53 UTC
Without MAKEOPTS="-j" for better clarity:

register component 'javaloader.uno.so' in registry '../../unxlngi6.pro/lib/uno_services.rdb' succesful!
register component 'javavm.uno.so' in registry '../../unxlngi6.pro/lib/uno_services.rdb' succesful!
regcomp -register  -br ../../unxlngi6.pro/misc/bridgetest/bootstrap.rdb -r ../../unxlngi6.pro/lib/uno_services.rdb -c \
        file:///var/tmp/portage/openoffice-2.0.3/work/ooo-build-2.0.3.0/build/OOO_2_0_3/testtools/source/bridgetest/../../unxlngi6.pro/class/testComponent.jar \        -env:URE_INTERNAL_JAVA_DIR=file:///var/tmp/portage/openoffice-2.0.3/work/ooo-build-2.0.3.0/build/OOO_2_0_3/solver/680/unxlngi6.pro/bin
using loader com.sun.star.loader.Java2
regcomp.bin: stack smashing attack in function void rtl_createUuid(sal_uInt8*, const sal_uInt8*, sal_Bool)()
Abort (core dumped)
dmake:  Error code 134, while making '../../unxlngi6.pro/lib/uno_services.rdb'
dmake:  '../../unxlngi6.pro/lib/uno_services.rdb' removed.
'---* tg_merge.mk *---'

ERROR: Error 65280 occurred while making /var/tmp/portage/openoffice-2.0.3/work/ooo-build-2.0.3.0/build/OOO_2_0_3/testtools/source/bridgetest
make: *** [stamp/build] Error 1
Comment 6 Andreas Proschofsky (RETIRED) gentoo-dev 2006-09-14 11:55:14 UTC
Just found this bug and taking it, as you don't even use hardened, so I'm not sure what the relation here should be.
Comment 7 Andreas Proschofsky (RETIRED) gentoo-dev 2006-09-14 12:25:53 UTC
But besides that, I'm going to close this bug immediately. This looks to me like another problem of CFLAGS-overoptimization. Please reduce them to a sane level, something like "-O2 -march=pentium4m -pipe". If the problem persists with generic CFLAGS please reopen this bug, otherwise I'm not going to take it.
Comment 8 Kevin F. Quinn (RETIRED) gentoo-dev 2006-09-14 12:30:32 UTC
(In reply to comment #4)
> CFLAGS="-O3 -march=pentium4m -mtune=pentium4m -mfpmath=sse -ftracer
> -funroll-loops -fprefetch-loop-arrays -fstack-protector-all
> -maccumulate-outgoing-args -pipe -ggdb3"

That's where it's coming from; "-fstack-protector-all" in CFLAGS.  We don't support getting SSP like that; our recommended approach is to use the hardened compiler.

The openoffice ebuild filters -fstack-protector, which is enough when one is using the hardened compiler, but not when people put -fstack-protector-all into CFLAGS.  I suggest changing the ebuild to:

filter-flags -fstack-protector -fstack-protector-all
Comment 9 Brant Gurganus 2006-09-14 13:53:41 UTC
Filtering -fstack-protector and -fstack-protector-all would allow the package to merge, but the underlying problem of stack overwrite is not fixed. If it is a false indication, fine; otherwise OpenOffice.org still needs fixed not to overwrite the stack.
Comment 10 Andreas Proschofsky (RETIRED) gentoo-dev 2006-09-15 04:12:50 UTC
Ok, sorry for my misunderstanding of this issue, reopening...
Comment 11 Andreas Proschofsky (RETIRED) gentoo-dev 2006-09-15 04:22:13 UTC
(In reply to comment #9)
> Filtering -fstack-protector and -fstack-protector-all would allow the package
> to merge, but the underlying problem of stack overwrite is not fixed. If it is
> a false indication, fine; otherwise OpenOffice.org still needs fixed not to
> overwrite the stack.
> 

You are right, still in this case this is an upstream issue, which should really be handled at openoffice.org, please file it at http://qa.openoffice.org/servlets/ProjectIssues . If a solution is found please reopen this bug so that we can remove the CFLAG-filters. Still until then the build breakage is resolved for us (I've added the necessary filtering-line), so closing again.
Comment 12 Gordon Malm (RETIRED) gentoo-dev 2009-07-10 23:13:44 UTC
Modified to only filter -fstack-protector and -fstack-protector all if <gcc-4.  Re-open if new related issues arise.