<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>141866</bug_id>
          
          <creation_ts>2006-07-27 02:18 0000</creation_ts>
          <short_desc>RPC Protocol Error with xen-tools-3.0.2-r2 and hardened profile</short_desc>
          <delta_ts>2007-08-26 22:13:27 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://lists.xensource.com/archives/html/xen-users/2006-07/msg00111.html</bug_file_loc>
          
          
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>144994</blocked>
          
          <everconfirmed>1</everconfirmed>
          <reporter>aross@gentoo.org</reporter>
          <assigned_to>xen@gentoo.org</assigned_to>
          <cc>bplant@iinet.net.au</cc>
    
    <cc>langthang@gentoo.org</cc>
    
    <cc>luckyluke@softhome.net</cc>

      

      
          <long_desc isprivate="0">
            <who>aross@gentoo.org</who>
            <bug_when>2006-07-27 02:18:14 0000</bug_when>
            <thetext>I&apos;ve just switched my dom0 to a hardened profile and (after recompiling toolchain and everything else) ran into the same problem (RPC Protocol Error when attempting to create domUs) as efphe reported on xen-users (http://tinyurl.com/lg7re).

Brad&apos;s solution (http://tinyurl.com/q5bya) of compiling python and xen-tools with gcc&apos;s hardened-nossp profile worked for me.

Portage 2.1-r1 (hardened/x86/2.6, gcc-3.4.6, glibc-2.3.6-r4, 2.6.16.18-xen i686)
=================================================================
System uname: 2.6.16.18-xen i686 AMD Athlon(tm)
Gentoo Base System version 1.6.15
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     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.11-r2
ACCEPT_KEYWORDS=&quot;x86&quot;
ACCEPT_LICENSE=&quot;&quot;
ARCH=&quot;x86&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;i686-pc-linux-gnu&quot;
CFLAGS=&quot;-mtune=athlon-xp -O2 -pipe -mno-tls-direct-seg-refs&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CLEAN_DELAY=&quot;5&quot;
CONFIG_PROTECT=&quot;/etc&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo&quot;
CVS_RSH=&quot;ssh&quot;
CXXFLAGS=&quot;-mtune=athlon-xp -O2 -pipe -mno-tls-direct-seg-refs&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
EDITOR=&quot;/usr/bin/vim&quot;
ELIBC=&quot;glibc&quot;
EMERGE_DEFAULT_OPTS=&quot;--ask --verbose&quot;
EMERGE_WARNING_DELAY=&quot;10&quot;
FEATURES=&quot;autoconfig collision-protect distlocks metadata-transfer sandbox sfperms strict test userfetch&quot;
FETCHCOMMAND=&quot;/usr/bin/wget -t 5 -T 60 --passive-ftp -P ${DISTDIR} ${URI}&quot;
GCC_SPECS=&quot;&quot;
GENTOO_MIRRORS=&quot;http://mirror.aarnet.edu.au/pub/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo&quot;
GRP_STAGE23_USE=&quot;x86 x86 berkdb crypt dlloader hardened nls pam pic readline ssl tcpd userlocales zlib&quot;
HOME=&quot;/home/aross&quot;
HOSTNAME=&quot;oak&quot;
INFOPATH=&quot;/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.16.1/info:/usr/share/gcc-data/i686-pc-linux-gnu/3.4.6/info&quot;
INPUT_DEVICES=&quot;mouse keyboard&quot;
KERNEL=&quot;linux&quot;
LESS=&quot;-R -M --shift 5&quot;
LESSOPEN=&quot;|lesspipe.sh %s&quot;
LOGNAME=&quot;aross&quot;
LS_COLORS=&quot;no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.qt=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.flac=01;35:*.mp3=01;35:*.mpc=00;36:*.ogg=00;36:*.wav=00;36:*.mid=00;36:*.midi=00;36:*.au=00;36:*.flac=00;36:*.aac=00;36:&quot;
MAIL=&quot;/var/mail/aross&quot;
MANPATH=&quot;/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.16.1/man:/usr/share/gcc-data/i686-pc-linux-gnu/3.4.6/man&quot;
PAGER=&quot;/usr/bin/less&quot;
PATH=&quot;/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.4.6&quot;
PKGDIR=&quot;/usr/portage//packages/x86/&quot;
PORTAGE_ARCHLIST=&quot;ppc s390 amd64 ppc64 x86-fbsd m68k arm sparc sh mips ia64 alpha ppc-macos hppa x86&quot;
PORTAGE_BINHOST_CHUNKSIZE=&quot;3000&quot;
PORTAGE_BIN_PATH=&quot;/usr/lib/portage/bin&quot;
PORTAGE_CALLER=&quot;emerge&quot;
PORTAGE_CONFIGROOT=&quot;/&quot;
PORTAGE_ELOG_CLASSES=&quot;warn error log&quot;
PORTAGE_ELOG_MAILFROM=&quot;portage&quot;
PORTAGE_ELOG_MAILSUBJECT=&quot;[portage] ebuild log for ${PACKAGE} on ${HOST}&quot;
PORTAGE_ELOG_MAILURI=&quot;root&quot;
PORTAGE_GID=&quot;250&quot;
PORTAGE_INST_GID=&quot;0&quot;
PORTAGE_INST_UID=&quot;0&quot;
PORTAGE_NICENESS=&quot;5&quot;
PORTAGE_PYM_PATH=&quot;/usr/lib/portage/pym&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=&apos;/distfiles&apos; --exclude=&apos;/local&apos; --exclude=&apos;/packages&apos;&quot;
PORTAGE_RSYNC_RETRIES=&quot;3&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTAGE_WORKDIR_MODE=&quot;0700&quot;
PORTDIR=&quot;/usr/portage/&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
PRELINK_PATH=&quot;&quot;
PRELINK_PATH_MASK=&quot;&quot;
PWD=&quot;/home/aross&quot;
PYTHONPATH=&quot;/usr/lib/portage/pym&quot;
RESUMECOMMAND=&quot;/usr/bin/wget -c -t 5 -T 60 --passive-ftp -P ${DISTDIR} ${URI}&quot;
ROOT=&quot;/&quot;
RPMDIR=&quot;/usr/portage/rpm&quot;
SHELL=&quot;/bin/bash&quot;
SHLVL=&quot;1&quot;
SSH_AUTH_SOCK=&quot;/tmp/ssh-loctl21401/agent.21401&quot;
SSH_CLIENT=&quot;10.2.0.1 51349 22&quot;
SSH_CONNECTION=&quot;10.2.0.1 51349 10.2.1.143 22&quot;
SSH_TTY=&quot;/dev/pts/3&quot;
STAGE1_USE=&quot;hardened pic userlocales&quot;
SYNC=&quot;rsync://gentoo.whitley.unimelb.edu.au/gentoo-portage&quot;
TERM=&quot;xterm-color&quot;
USE=&quot;acl bash-completion berkdb bzip2 crypt dlloader hardened ncurses nls nptl pam pic python readline ssl symlink sysfs tcpd unicode userlocales x86 xorg zlib elibc_glibc input_devices_mouse input_devices_keyboard kernel_linux userland_GNU&quot;
USER=&quot;aross&quot;
USERLAND=&quot;GNU&quot;
USE_EXPAND=&quot;DVB_CARDS ELIBC FCDSL_CARDS FRITZCAPI_CARDS INPUT_DEVICES KERNEL LINGUAS LIRC_DEVICES USERLAND VIDEO_CARDS&quot;
USE_EXPAND_HIDDEN=&quot;ELIBC KERNEL USERLAND&quot;
USE_ORDER=&quot;env:pkg:conf:defaults&quot;
XARGS=&quot;xargs -r&quot;
_=&quot;/usr/bin/emerge&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chrb@gentoo.org</who>
            <bug_when>2006-08-04 08:10:42 0000</bug_when>
            <thetext>Any idea how this can be fixed in the ebuild?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aross@gentoo.org</who>
            <bug_when>2006-08-11 18:06:24 0000</bug_when>
            <thetext>I won&apos;t be in a position to test this for a few days, but using &quot;append-flags -fno-stack-protector&quot; should have the same benefit as using gcc&apos;s hardened-nossp profile.

However, we can&apos;t force this in the python ebuild - perhaps pkg_setup can check if python was built with ssp until a real fix can be found.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aross@gentoo.org</who>
            <bug_when>2006-08-13 00:37:49 0000</bug_when>
            <thetext>Thanks to solar on IRC for suggesting &quot;scanelf -s __guard -q `which python`&quot; to check if python was built using ssp.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aross@gentoo.org</who>
            <bug_when>2006-08-14 00:16:12 0000</bug_when>
            <thetext>Fixed in xen-tools-3.0.2-r3</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>langthang@gentoo.org</who>
            <bug_when>2006-08-14 14:27:06 0000</bug_when>
            <thetext>I have been using hardened profile for a long time without this issue. I really don&apos;t like this &quot;workaround&quot; (reemerge python with -fno-stack-protector) . I&apos;ll reemerge my system with &quot;-mno-tls-direct-seg-refs&quot; to see if I can reproduce this bug.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ray@apollo.lv</who>
            <bug_when>2006-08-15 12:02:24 0000</bug_when>
            <thetext>I also dont like this &quot;workaround&quot;.
I solved this problem by &apos;custom-cflags&apos; USE option.
My cflags in make.conf:
CFLAGS=&quot;-pipe -march=prescott -Os -march=prescott -fomit-frame-pointer -frename-registers -fweb -freorder-blocks
-mno-tls-direct-seg-refs&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aross@gentoo.org</who>
            <bug_when>2006-08-15 23:59:35 0000</bug_when>
            <thetext>USE=custom-cflags works for me as well - thanks, Raimonds.

Brad, I take it you&apos;re not using custom-cflags?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>bplant@iinet.net.au</who>
            <bug_when>2006-08-16 02:21:56 0000</bug_when>
            <thetext>(In reply to comment #7)
&gt; USE=custom-cflags works for me as well - thanks, Raimonds.
&gt; 
&gt; Brad, I take it you&apos;re not using custom-cflags?
&gt; 

No, I wasn&apos;t using the custon-cflags USE flag. I just recompiled python and xen-tools using the hardened compiler and I seem to be able to create domains without any problems. I&apos;m not aware of why this would have started working suddenly.

Python was definitely compiled with stack smashing:

xen2 ~ # scanelf -s __guard /usr/bin/python
 TYPE   SYM FILE
ET_DYN __guard /usr/bin/python

And I definitely compiled xen-tools without the custom-cflags USE flag:

xen2 ~ # emerge -pv xen-tools

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] app-emulation/xen-tools-3.0.2-r3  -custom-cflags -debug -doc +hardened +screen +sdl +vnc 0 kB

I was able to successfully create guest domains with both xen-tools 3.0.2-r1 (what I was originally using) and with 3.0.2-r3 which I only updated to today. I did however have to comment out the section that checked to see if python was compiled with stack smashing.

Cheers,

Brad</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>swegener@gentoo.org</who>
            <bug_when>2006-08-16 11:18:40 0000</bug_when>
            <thetext>On hardened amd64 xend is also running fine with ssp:

xen1 ~ # scanelf -s __guard /usr/bin/python
 TYPE   SYM FILE
ET_DYN __guard /usr/bin/python</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>luckyluke@softhome.net</who>
            <bug_when>2006-12-28 08:31:47 0000</bug_when>
            <thetext>I did some tests today, and just to summarize current status on hardened x86:

- the RPC Protocol Error is caused by python being compiled in the &apos;normal way&apos;, eg. with hardened compiler, usual CFLAGS.
- recompiling python-2.4.3-r4 with i386-pc-linux-gnu-3.4.6-hardenednossp does solve the problem (no need to use vanilla, nossp is ok)
- recompiling xen-tools with other (nossp, vanilla, anything) compilers or CFLAGS does not solve the problem. If python is compiled without ssp, xen-tools  will work ok even if compiled with the usual hardened compiler.
- don&apos;t know about xen-tools-3.0.2-r3 (see &lt;a href=&quot;#c4&quot;&gt;comment #4&lt;/a&gt;), but xen-tools-3.0.2-r4 does have this problem

From my make.conf:
CFLAGS=&quot;-O2 -march=i686 -pipe -mno-tls-direct-seg-refs&quot;
USE=&quot;userlocales sysfs screen nptl ncurses snmp&quot;

Ebuilds used:
python-2.4.3-r4
xen-sources-2.6.16.28
xen-tools-3.0.2-r4
xen-3.0.2

Everything compiled with hardened compiler except python, this way the system works fine with hardened gentoo linux domU&apos;s (still looking at why Yuan Jue&apos;s freebsd domU does not work, but that&apos;s another story).

Hope this helps.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hcp@prytz.net</who>
            <bug_when>2007-02-21 23:15:23 0000</bug_when>
            <thetext>Is there any progress on this problem?

Just to confuse things a bit, I have the same problem as described here, but without using hardened.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>luckyluke@softhome.net</who>
            <bug_when>2007-08-20 12:41:01 0000</bug_when>
            <thetext>I can report that this problem disappeared using xen-tools-3.0.4_p1, xen-3.0.4_p1 on hardened/amd64 using default (hardened PIE+SSP) x86_64-pc-linux-gnu-3.4.6.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>marineam@gentoo.org</who>
            <bug_when>2007-08-26 22:13:27 0000</bug_when>
            <thetext>Xen 3.0.2 has been dropped from portage and both 3.0.4 and 3.1.0 seem to be working fine on amd64 and x86 hardened. Closing bug, if anyone still hits this problem using &gt;=3.0.4 please re-open.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>