Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 144032 - exec stacks in app-emulation/xen
Summary: exec stacks in app-emulation/xen
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Xen Devs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-15 12:13 UTC by Charlie Shepherd (RETIRED)
Modified: 2007-07-10 17:35 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fixes exec stacks in xen (exec-stacks.patch,1.81 KB, patch)
2006-08-15 12:14 UTC, Charlie Shepherd (RETIRED)
Details | Diff
a more complete patch (including makefile) (xen-exec.patch,2.66 KB, patch)
2006-09-18 15:24 UTC, oliver jucknath
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charlie Shepherd (RETIRED) gentoo-dev 2006-08-15 12:13:37 UTC
Installing Xen gives QA warnings about executable stacks. Here is /var/tmp/portage/xen-3.0.2/temp/scanelf-execstack.log

--- --- RWX work/xen-3.0.2/xen/xen
!WX --- --- work/xen-3.0.2/xen/arch/x86/hvm/svm/x86_32/exits.o
!WX --- --- work/xen-3.0.2/xen/arch/x86/hvm/svm/x86_32/built_in.o
!WX --- --- work/xen-3.0.2/xen/arch/x86/hvm/vmx/x86_32/exits.o
!WX --- --- work/xen-3.0.2/xen/arch/x86/hvm/vmx/x86_32/built_in.o
!WX --- --- work/xen-3.0.2/xen/arch/x86/boot/x86_32.o
!WX --- --- work/xen-3.0.2/xen/arch/x86/x86_32/entry.o
!WX --- --- work/xen-3.0.2/xen/arch/x86/trampoline.o
--- --- RWX work/xen-3.0.2/xen/xen-syms
--- --- RWX image/boot/xen-syms-3.0.2

The attached patch fixes all except for image/boot/xen-syms-3.0.2, which I think should be installed as 755 anyway. The two relevant lines are:

install -m0644 /var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/xen-syms /var/tmp/portage/xen-3.0.2/image//boot/xen-syms-3.0.2

and the output of  ls -l var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/xen-syms

-rwxr-xr-x 1 portage portage 2577677 2006-08-15 20:08 /var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/xen-syms
Comment 1 Charlie Shepherd (RETIRED) gentoo-dev 2006-08-15 12:14:58 UTC
Created attachment 94343 [details, diff]
Fixes exec stacks in xen
Comment 2 oliver jucknath 2006-09-18 15:24:28 UTC
Created attachment 97368 [details, diff]
a more complete patch (including makefile)

In the former patch the Makefile is still to be edited by hand. This patch includes a single line change in the Makefile to fix the file permissions for the symbol file.
Comment 3 Brad Plant 2006-09-25 16:23:47 UTC
I used the second patch (although I had to modify it first as it wouldn't apply). It has removed most of the exec stacks, but the following still remains.

--- --- RWX boot/xen-syms-3.0.2

I tested the HVM capabilities using an XP install CD and it still appeared to work.
Comment 4 Andrew Ross (RETIRED) gentoo-dev 2006-10-03 04:27:18 UTC
No need for the Makefile patch, as xen-syms-3.0.2 isn't meant to be executed - it's used only in conjunction with gdb and a xen core dump.
Comment 5 Charlie Shepherd (RETIRED) gentoo-dev 2006-10-04 22:50:46 UTC
It also doesn't fix anything - scanelf still complains about exec-stacks in xen-syms.
Comment 6 Dennis Petschull 2006-11-02 00:10:43 UTC
(In reply to comment #5)
> It also doesn't fix anything - scanelf still complains about exec-stacks in
> xen-syms.
> 

Yep. Same here. It would be great if someone knows a fix to this problem.
Comment 7 Andrew Ross (RETIRED) gentoo-dev 2006-11-03 16:06:31 UTC
I spoke to spb in #gentoo-hardened and apparently there's no point addressing exec stacks in anything which is loaded prior to the kernel (eg. the xen hypervisor), since non-executable stacks won't be enforced anyway.

Even with the GNU stack markings applied, there's still a writable/executable segment triggering a QA warning (or failure, if FEATURES=stricter), which I'd like to address by adding QA_WX_LOAD="boot/xen-syms-${XEN_VERSION/_/-}" to the ebuild. Since the GNU stack markings are apparently useless in this situation, I'd rather avoid them and keep things as close to vanilla upstream as possible.

However, I need the agreement of QA before proceeding with the addition of QA_WX_LOAD, as per man 5 ebuild
Comment 8 SpanKY gentoo-dev 2006-11-03 16:10:33 UTC
this is correct ... if the code's role does not involve actually running under the linux kernel, then exec stack markings are meanlingless
Comment 9 Andrew Ross (RETIRED) gentoo-dev 2007-02-13 08:16:31 UTC
The solution proposed in comment #7 should be applied when this package is next bumped - it's not big enough to warrant a bump on its own.
Comment 10 Micheal Marineau (RETIRED) gentoo-dev 2007-02-14 01:38:01 UTC
In addition to boot/xen-syms I am setting QA_WX_LOAD for usr/lib/xen/boot/hvmloader in the xen-tools ebuild. hvmloader is used to emulate the pc bios and bootstrap fully vurtualized kernels.
Comment 11 Micheal Marineau (RETIRED) gentoo-dev 2007-07-10 17:35:05 UTC
I should have closed this bug ages ago, resolving.