Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 177206 - emerge of gnustep-base/gnustep-gui-0.11.0 fails with trampoline error on hardened kernel
Summary: emerge of gnustep-base/gnustep-gui-0.11.0 fails with trampoline error on hard...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-05 17:13 UTC by Fredric Johansson
Modified: 2010-07-27 23:32 UTC (History)
1 user (show)

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


Attachments
Kernel config (config,41.83 KB, text/plain)
2007-05-06 12:53 UTC, Fredric Johansson
Details
Log from emerge gnustep-gui (gnustep-gui.log.gz,24.05 KB, application/octet-stream)
2007-05-06 13:11 UTC, Fredric Johansson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fredric Johansson 2007-05-05 17:13:08 UTC
Emerge of gnustep-gui is failing on hardened kernel(2.6.21) with pax enabled when trying to run make_services. Relevant info below

Output of emerge:
i686-pc-linux-gnu-gcc  -rdynamic       -fgnu-runtime -o GSspell.service/./GSspell \
        ./shared_obj/GSspell.o  -L/usr/lib -L../Source/./shared_obj -L../Model/./shared_obj -L/var/tmp/portage/gnustep-base/gnustep-gui-0.11.0/temp/Library/Libraries -L/usr/GNUstep/Local/Library/Libraries -L/usr/GNUstep/Network/Library/Libraries -L/usr/GNUstep/System/Library/Libraries -lgnustep-gui -laudiofile -laspell -lgif -lpng -ltiff -lz -ljpeg -lm -lgnustep-base -lpthread -lobjc -lm
/usr/GNUstep/System/Library/Makefiles/mkinstalldirs GSspell.service/Resources
(echo "{"; echo '  NOTE = "Automatically generated, do not edit!";'; \
          echo "  NSExecutable = \"GSspell\";"; \
          cat GSspellInfo.plist; \
          echo "}") >GSspell.service/Resources/Info-gnustep.plist ;\
        if ././shared_obj/make_services --test GSspell.service/Resources/Info-gnustep.plist; then : ; else rm -f GSspell.service/Resources/Info-gnustep.plist; false; \
        fi
trampoline: cannot make memory executable
/bin/sh: line 5: 19823 Avbruten (SIGABRT)      ././shared_obj/make_services --test GSspell.service/Resources/Info-gnustep.plist
make[2]: *** [GSspell.service/Resources/Info-gnustep.plist] Fel 1
make[1]: *** [GSspell.all.service.variables] Fel 2
make[1]: Leaving directory `/var/tmp/portage/gnustep-base/gnustep-gui-0.11.0/work/gnustep-gui-0.11.0/Tools'
make: *** [internal-all] Fel 2


relevant part from dmesg:
grsec: exec of /var/tmp/portage/gnustep-base/gnustep-gui-0.11.0/work/gnustep-gui-0.11.0/Tools/shared_obj/make_services (././shared_obj/make_services --test GSspell.service/Resources/Info-gnustep.plist ) by /bin/bash[sh:16457] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[sh:16454] uid/euid:0/0 gid/egid:0/0
grsec: signal 6 sent to /var/tmp/portage/gnustep-base/gnustep-gui-0.11.0/work/gnustep-gui-0.11.0/Tools/shared_obj/make_services[make_services:16457] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[sh:16454] uid/euid:0/0 gid/egid:0/0
grsec: denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /var/tmp/portage/gnustep-base/gnustep-gui-0.11.0/work/gnustep-gui-0.11.0/Tools/shared_obj/make_services[make_services:16457] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[sh:16454] uid/euid:0/0 gid/egid:0/0
Comment 1 Kevin F. Quinn (RETIRED) gentoo-dev 2007-05-06 11:44:59 UTC
hmm - gnustep people, does gnustep-gui create its own tools for building/linking stuff?  Is 'make_services' such a tool?  PaX/gcc/binutils would normally take care of this automatically.

Fredric - could you post your kernel configuration, please (at least the 'PAX' bits)?  Also please attach the full build log:

% emerge gnustep-gui 2>&1 > gnustep-gui.log

Comment 2 Fredric Johansson 2007-05-06 12:53:31 UTC
Created attachment 118331 [details]
Kernel config

My kernelconfig
Comment 3 Fredric Johansson 2007-05-06 13:11:50 UTC
Created attachment 118342 [details]
Log from emerge gnustep-gui
Comment 4 Kevin F. Quinn (RETIRED) gentoo-dev 2007-05-06 22:43:19 UTC
Thanks Fredric.

That confirms you do have trampoline emulation enabled ok; and it does look like gnustep has a home-built build tool that doesn't manage PT_GNUSTACK (maybe).

It's not a quick thing to work on - gnustep needs objc which I've never bothered building, so I won't be able to work anything out quickly.
Comment 5 Fabian Groffen gentoo-dev 2007-05-06 22:47:29 UTC
for as much as this is interesting information, gnustep uses mostly gnustep-make to build packages.  This is a build-system that's mostly configure-less.  Further, execution of binaries usually goes through a deamon thing.
Comment 6 Bernard Cafarelli gentoo-dev 2007-06-13 15:45:04 UTC
AFAIK, the ffcall lib (which has trampoline things everywhere) uses parts of gcc code for it. So it may be neeeded to patch ffcall for hardened?

A few things to test, Fredric if you may: re-merge gnustep-base with USE=gcc-libffi (which can be used instead of ffcall, but is not the recommended solution anymore), try ffcall from the gnustep overlay (more up-to-date, but I'm not sure if it changes any hardened problems).
http://overlays.gentoo.org/proj/gnustep/wiki
Comment 7 Fredric Johansson 2007-08-05 14:18:27 UTC
Sorry for the delayed info. if gnustep-base is compiled with USE=gcc-libffi then compiling gnustep-gui works. When using ffcall it fails with the trampoline error, even with the ffcall from the overlay
Comment 8 Bernard Cafarelli gentoo-dev 2007-08-11 14:11:25 UTC
Good to know. The bad news is that usually libffi does not work as well as ffcall in gnustep

If you get a gnustep env working correctly though, we could force libffi on hardened (until we can see what changes could help in gnustep-base packages)
Comment 9 Bernard Cafarelli gentoo-dev 2007-08-23 18:47:16 UTC
Bug #52505 had some infos on this (but not many). Seems libffi is the needed way on hardened, if it works at all: tests on amd64 with libffi resulted in every single gnustep application segfaulting
Comment 10 Bernard Cafarelli gentoo-dev 2008-08-27 07:53:19 UTC
Can you test with gnustep-base-1.16.2? This new release now has working libffi on amd64, and SVN commits refered to hardened gcc too...
Comment 11 Fredric Johansson 2008-09-06 15:46:19 UTC
Using ffcall still fails in the same way. To your knowledge I dont use this anymore so Im a bit restricted in helping with this
Comment 12 Daniel Kowalski 2008-09-15 00:36:04 UTC
I recompiled gcc with libffi flag and gnustep-base with gcc-libffi, but emerging gnustep-gui still fails with error:
               -o obj/NSGraphicsContext.o
NSGraphicsContext.m: In function ‘GSCurrentContext’:
NSGraphicsContext.m:93: warning: instance variable ‘_gcontext’ is @private; this will be a hard error in the future
NSGraphicsContext.m: In function ‘+[NSGraphicsContext setCurrentContext:]’:
NSGraphicsContext.m:162: error: instance variable ‘_gcontext’ is declared private
NSGraphicsContext.m:162: error: instance variable ‘_gcontext’ is declared private
make[2]: *** [obj/NSGraphicsContext.o] Błąd 1
make[1]: *** [libgnustep-gui.all.library.variables] Błąd 2
make[1]: Opuszczenie katalogu `/var/tmp/portage/gnustep-base/gnustep-gui-0.12.1/work/gnustep-gui-0.12.1/Source'
make: *** [internal-all] Błąd 2
Comment 13 Daniel Kowalski 2008-09-15 00:39:22 UTC
I struggled with this error also here:
#236736
Comment 14 Magnus Granberg gentoo-dev 2010-07-15 23:42:56 UTC
Is this still a problem in newer gnustep-gui-0.18.0?
Comment 15 Magnus Granberg gentoo-dev 2010-07-27 23:09:02 UTC
It works for me with PAX/GRSec on and Hardened toolchain.
And nothing in the log for trampolines.

Making all for service GSspell...
cd .; \
        /usr/GNUstep/System/Library/Makefiles/mkinstalldirs ./obj/GSspell.obj/
/usr/GNUstep/System/Library/Makefiles/mkinstalldirs ./GSspell.service/.
x86_64-pc-linux-gnu-gcc GSspell.m -c \
              -MMD -MP -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -D_REENTRANT -fPIC -Wall -DGSWARN -DGSDIAGNOSE -W$
               -o obj/GSspell.obj/GSspell.m.o
x86_64-pc-linux-gnu-gcc  -rdynamic  -Wl,-O1 -Wl,-rpath=/usr/GNUstep/System/Library/Libraries   -Wl,-O1   -fgnu-runtime -o GSspell.service/./GSspell \
        ./obj/GSspell.obj/GSspell.m.o   -Wl,-O1 -Wl,-rpath=/usr/GNUstep/System/Library/Libraries -L/usr/lib64  -L../Source/./obj -L../Model/./obj  -L/usr/GNUstep/System$
/usr/GNUstep/System/Library/Makefiles/mkinstalldirs GSspell.service/Resources
(echo "{"; echo '  NOTE = "Automatically generated, do not edit!";'; \
          echo "  NSExecutable = \"GSspell\";"; \
          if [ -r "GSspellInfo.plist" ]; then \
            cat GSspellInfo.plist; \
          fi; \
          echo "}") >GSspell.service/Resources/Info-gnustep.plist ;\
        if ././obj/make_services --test GSspell.service/Resources/Info-gnustep.plist; then : ; else rm -f GSspell.service/Resources/Info-gnustep.plist; false; \
        fi
make[1]: Leaving directory `/var/tmp/portage/gnustep-base/gnustep-gui-0.18.0/work/gnustep-gui-0.18.0/Tools'
--------------
Portage 2.2_rc67 (hardened/linux/amd64/10.0, gcc-4.4.4, glibc-2.11.2-r0, 2.6.34-hardened-r1 x86_64)
=================================================================
System uname: Linux-2.6.34-hardened-r1-x86_64-Intel-R-_Xeon-R-_CPU_E5420_@_2.50GHz-with-gentoo-2.0.1
Timestamp of tree: Sun, 25 Jul 2010 21:45:01 +0000
app-shells/bash:     4.1_p7
dev-lang/python:     2.6.5-r2
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
virtual/os-headers:  2.6.34
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core2"
CHOST="x86_64-pc-linux-gnu"
Comment 16 Magnus Granberg gentoo-dev 2010-07-27 23:32:24 UTC
Looks likes it is fixed on newer versions.
Reopen if it still have the error.