Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 541064 - dev-libs/efl-1.12.2: elua gets killed by PaX during ebuild
Summary: dev-libs/efl-1.12.2: elua gets killed by PaX during ebuild
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-22 17:28 UTC by Falk Schilling
Modified: 2015-03-28 18:11 UTC (History)
1 user (show)

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


Attachments
patch to call paxctl (0001-Add-paxctl-call-to-avoid-crashing-because-of-RWX-map.patch,761 bytes, patch)
2015-03-26 13:34 UTC, Markus Walter
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Falk Schilling 2015-02-22 17:28:01 UTC
When upgrading dev-libs/efl-1.11.2 to recent version (1.12.2) on hardened/linux/x86/selinux profile, PaX is killing the elua binary during make process with "PANIC: unprotected error in call to Lua API (runtime code generation failed, restricted kernel?)".


Reproducible: Always

Steps to Reproduce:
1. tar xvfj efl-1.12.2.tar.bz2
2. cd efl-1.12.2
3. ./configure && make
-> unprotected error
4. paxctl -m src/bin/elua/.libs/elua
5. ./configure && make
-> now correctly building


Expected Results:  
Makefile should disable PaX's mprotect for elua binary.

# emerge efl
# ...
libtool: link: i686-pc-linux-gnu-gcc -std=gnu99 -O2 -march=native -pipe -Wl,-O1 -Wl,--as-needed -o lib/ecore_x/.libs/ecore_x_vsync lib/ecore_x/lib_ecore_x_ecore_x_vsync-ecore_x_vsync_tool.o lib/ecore_x/lib_ecore_x_ecore_x_vsync-ecore_x_vsync_tool_glx.o -fvisibility=hidden -fdata-sections -ffunction-sections -Wl,--gc-sections -fno-strict-aliasing -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -fvisibility=hidden -fdata-sections -ffunction-sections -Wl,--gc-sections -fno-strict-aliasing -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -fvisibility=hidden -fdata-sections -ffunction-sections -Wl,--gc-sections -fno-strict-aliasing -Wl,--as-needed -Wl,--no-copy-dt-needed-entries  lib/efl/.libs/libefl.so lib/ecore/.libs/libecore.so lib/eina/.libs/libeina.so lib/eet/.libs/libeet.so -L/usr/lib lib/eo/.libs/libeo.so lib/ecore_con/.libs/libecore_con.so /var/tmp/portage/dev-libs/efl-1.12.2/work/efl-1.12.2/src/lib/ecore/.libs/libecore.so /var/tmp/portage/dev-libs/efl-1.12.2/work/efl-1.12.2/src/lib/efl/.libs/libefl.so /var/tmp/portage/dev-libs/efl-1.12.2/work/efl-1.12.2/src/lib/eet/.libs/libeet.so -lssl -lcrypto -lz -ljpeg /var/tmp/portage/dev-libs/efl-1.12.2/work/efl-1.12.2/src/lib/eo/.libs/libeo.so /var/tmp/portage/dev-libs/efl-1.12.2/work/efl-1.12.2/src/lib/eina/.libs/libeina.so -lsystemd -lrt -ldl -lpthread -lm
ELUA_EOLIAN_LIBRARY_PATH=../src/lib/eolian/.libs EFL_RUN_IN_TREE=1 ../src/bin/elua/elua lualian -I./lib/eo -I./lib/evas/canvas -I./lib/edje -I./lib/efl/interfaces -I./lib/ecore_audio -I./lib/ecore -I./lib/ecore_con -o lib/ecore_audio/ecore_audio_out_pulse.eo.lua lib/ecore_audio/ecore_audio_out_pulse.eo
ELUA_EOLIAN_LIBRARY_PATH=../src/lib/eolian/.libs EFL_RUN_IN_TREE=1 ../src/bin/elua/elua lualian -I./lib/eo -I./lib/evas/canvas -I./lib/edje -I./lib/efl/interfaces -I./lib/ecore_audio -I./lib/ecore -I./lib/ecore_con -o lib/ecore_audio/ecore_audio_in_tone.eo.lua lib/ecore_audio/ecore_audio_in_tone.eo
ELUA_EOLIAN_LIBRARY_PATH=../src/lib/eolian/.libs EFL_RUN_IN_TREE=1 ../src/bin/elua/elua lualian -I./lib/eo -I./lib/evas/canvas -I./lib/edje -I./lib/efl/interfaces -I./lib/ecore_audio -I./lib/ecore -I./lib/ecore_con -o lib/ecore_con/ecore_con_base.eo.lua lib/ecore_con/ecore_con_base.eo
ELUA_EOLIAN_LIBRARY_PATH=../src/lib/eolian/.libs EFL_RUN_IN_TREE=1 ../src/bin/elua/elua lualian -I./lib/eo -I./lib/evas/canvas -I./lib/edje -I./lib/efl/interfaces -I./lib/ecore_audio -I./lib/ecore -I./lib/ecore_con -o lib/ecore_con/ecore_con_client.eo.lua lib/ecore_con/ecore_con_client.eo
ELUA_EOLIAN_LIBRARY_PATH=../src/lib/eolian/.libs EFL_RUN_IN_TREE=1 ../src/bin/elua/elua lualian -I./lib/eo -I./lib/evas/canvas -I./lib/edje -I./lib/efl/interfaces -I./lib/ecore_audio -I./lib/ecore -I./lib/ecore_con -o lib/ecore_con/ecore_con_server.eo.lua lib/ecore_con/ecore_con_server.eo
ELUA_EOLIAN_LIBRARY_PATH=../src/lib/eolian/.libs EFL_RUN_IN_TREE=1 ../src/bin/elua/elua lualian -I./lib/eo -I./lib/evas/canvas -I./lib/edje -I./lib/efl/interfaces -I./lib/ecore_audio -I./lib/ecore -I./lib/ecore_con -o lib/ecore_con/ecore_con_connector.eo.lua lib/ecore_con/ecore_con_connector.eo
PANIC: unprotected error in call to Lua API (runtime code generation failed, restricted kernel?)
Makefile:33710: recipe for target 'lib/ecore_con/ecore_con_server.eo.lua' failed
make[4]: *** [lib/ecore_con/ecore_con_server.eo.lua] Killed
make[4]: *** Deleting file 'lib/ecore_con/ecore_con_server.eo.lua'
make[4]: *** Waiting for unfinished jobs....


# emerge --info
Portage 2.2.14 (python 3.3.5-final-0, hardened/linux/x86/selinux, gcc-4.8.3, glibc-2.19-r1, 3.17.7-hardened-r1 i686)
=================================================================
System uname: Linux-3.17.7-hardened-r1-i686-Intel-R-_Core-TM-2_CPU_L7400_@_1.50GHz-with-gentoo-2.2
KiB Mem:     2577660 total,    275196 free
KiB Swap:    2097148 total,   1442704 free
Timestamp of tree: Sun, 22 Feb 2015 09:00:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p53
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.1-r4
dev-lang/python:          2.7.9-r1, 3.3.5-r1, 3.4.1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6-r1, 1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.4
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo enlightenment emacs
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-march=i686 -O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=i686 -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/enlightenment /var/lib/layman/emacs"
USE="3dnow X acl alsa avahi bazaar berkdb bluetooth bzip2 cli consolekit cracklib crypt cups cxx dbus dri fontconfig fuse gdbm git gnome gphoto2 gstreamer gtk3 hardened iconv ipv6 jpeg laptop libav mmx modules mp3 ncurses nls nptl open_perms openmp pam pax_kernel pcre pcsc-lite pdf pic png qt4 readline selinux session smartcard sse sse2 ssl subversion systemd tcpd truetype udisks unconfined unicode urandom x86 xattr xetex xft xtpax zlib" ABI_X86="32" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 1 Markus Walter 2015-03-26 12:51:40 UTC
It tried 

paxctl-ng -m /var/tmp/portage/dev-libs/efl-1.13.1/work/efl-1.13.1/src/bin/elua/.libs/elua

which did the trick for me.
Comment 2 Markus Walter 2015-03-26 13:34:16 UTC
Created attachment 399814 [details, diff]
patch to call paxctl

For me the attached patch worked. It is a bit inelegant since paxctl is called before every invokation of the offending binary instead of once after it's creation. Also this hardcodes the path, somebody with autotools-foo could add the proper semantics.
Comment 3 Falk Schilling 2015-03-28 18:11:59 UTC
Thanks for your efforts! It's a workable solution. Maybe this patch can be applied during the ebuild process on a hardened-system to avoid these issues!