Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 215211 - dev-libs/crypto++ fails on hardened with missing register in GENERAL_REGS asm
Summary: dev-libs/crypto++ fails on hardened with missing register in GENERAL_REGS asm
Status: RESOLVED UPSTREAM
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:
: 215560 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-28 15:27 UTC by Attila Tóth
Modified: 2008-04-02 16:47 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 Attila Tóth 2008-03-28 15:27:08 UTC
This one is closely related to bug 175627, IMHO.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2008-03-28 20:29:01 UTC
Reopen with some errors and emerge --info output.

http://www.gentoo.org/doc/en/bugzilla-howto.xml
Comment 2 Attila Tóth 2008-03-30 12:46:18 UTC
vmac.cpp: In member function ‘void CryptoPP::VMAC_Base::VHASH_Update_SSE2(const CryptoPP::word64*, size_t, int)’:
vmac.cpp:367: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
make: *** [vmac.o] Error 1

emerge --info:
Portage 2.1.4.4 (hardened/x86/2.6, gcc-4.1.2, glibc-2.6.1-r0, 2.6.23-hardened-r6 i686)
=================================================================
System uname: 2.6.23-hardened-r6 i686 AMD Athlon(TM) MP 1600+
Timestamp of tree: Fri, 28 Mar 2008 12:30:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.4
dev-lang/python:     2.4.4-r9
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
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
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -mtune=athlon-mp -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/mozilla/defaults/pref /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /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/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -mtune=athlon-mp -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.inf.elte.hu/ http://gentoo.inode.at/"
LANG="hu_HU.utf8"
LC_ALL="hu_HU.utf8"
LINGUAS="hu en"
MAKEOPTS="-j3"
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"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 7zip GNU X X509 Xaw3d a52 aac aalib acl acpi aiglx alsa amr amrnb amrwb aotuv apache2 asf audiofile bash-completion bcmath bdf berkdb bidi binfilter bitmap-fonts bittorrent blas bluetooth branding browserplugin bzip2 cairo caps cdda cddb cdparanoia cdr cdrom cgi chardet checkpath cli contentcache cracklib crypt css ctype cups curl curlwrappers dba dbm dbus devhelp device-mapper dga dhcp dia dicom disassembler discard-path divx divx4linux djbfft djvu dlloader dmi dri dts dv dvd dvdnav dvdr dvdread dvi eds emerald encode enscript evo exif expat extensions extras fam fame ffmpeg fftw finger firefox flac flash flatfile follow-xff fontconfig foomaticdb force-cgi-redirect fortran fpx ftp gd gdl gif gimp gimpprint glade glibc glitz gmedia gmp gnet gnome gnomecanvas gopher gphoto2 gpm graphviz gs gsl gsm gstreamer gtk gtk2 gtkhtml h323 hal hardened hub iconv idea idn iksemel imagemagick imap imlib inherit-graph inifile inkjar inode irda jabber java java-internal javascript jingle jpeg jpeg2k jrtplib ladspa lame lapack lcms libburn libcaca libnotify libplot lm_sensors logitech-mouse lzo lzw m17n-lib mad matroska mbox mcal md5sum memlimit mhash midi mikmod milter ming mjpeg mmap mmx mmxext mng mode-owner motif mozbranding mozcalendar mp2 mp3 mp4 mpeg mpeg1 mpeg2 mplayer musepack mysql mysqli nautilus ncurses network nls nopop3d nptl nptlonly nsplugin ntfs oav odbc odk ogg oggvorbis onaccess openexr opengl overload pam pam_chroot pam_timestamp pango pccts pcmcia pcntl pcre pda pdf pear perl php pic plotutils png pnm posix postscript ppds python quicktime quotas rar rc5 readline real realmedia reflection reiserfs replytolist rle rtc samba sasl scanner scenarios screen sdl sensord session sftplogging sid sieve skins slang smp sms sndfile soap sockets sound sourceview sox speex spell spf srt sse ssl subtitles subversion suhosin svg svnserve syslog sysvipc t1lib tagwriting tcl tcltk tcpd tetex tga theora threads threadsafe tiff tk tlen tokenizer toolbar tools totem transcode truetype truetype-fonts type1-fonts udev underscores unicode urandom usb userlocales v4l v4l2 valgrind vcd vidix virus-scan visualization vlm volpack vorbis wavplay wifi win32codecs wma wmf wmp wxwindows x264 x86 xattr xforms xine xmedcon xml xml2 xmlreader xmlrpc xmlwriter xorg xpm xsl xv xvid yahoo zip zlib zvbi" ALSA_CARDS="cmipci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter 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 headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias auth_digest version filter ident charset_lite asis dbd authn_dbd proxy proxy_ajp proxy_balancer proxy_connect proxy_http imagemap mudflap" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="keyboard mouse acecad" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="hu en" USERLAND="GNU" VIDEO_CARDS="radeon v4l"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 solar (RETIRED) gentoo-dev 2008-03-30 15:33:31 UTC
Here is the problematic code that is using the pic register directly. Ever other register is used/abused as well. compile with nopie.. 



#ifdef __GNUC__
    ".att_syntax prefix;"
    AS2(    mov %0, %%ebx)
        : "=m" (temp)
        : "m" (m_L1KeyLength), "c" (blocksRemainingInWord64), "S" (data), "D" (nhK+tagPart*2), "d" (m_isFirstBlock), "a" (polyS+tagPart*4)
        : "memory", "cc"
    );
#endif



make CXXFLAGS=-fno-pie LDFLAGS=-nopie  ; #worked for me.
being that there is not a single free register there is little to 
nothing we can do to fix it. You can ask upstream to not use the pic register.
Comment 4 Attila Tóth 2008-03-31 09:08:12 UTC
(In reply to comment #3)
> make CXXFLAGS=-fno-pie LDFLAGS=-nopie  ; #worked for me.

Yes. Fortunately I don't need amule, so I removed the library and the application.

> being that there is not a single free register there is little to 
> nothing we can do to fix it. You can ask upstream to not use the pic register.

Done.
Comment 5 Alon Bar-Lev (RETIRED) gentoo-dev 2008-04-02 16:47:51 UTC
*** Bug 215560 has been marked as a duplicate of this bug. ***