Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 368153 - net-libs/nodejs-0.4.7 denied RWX mmap on hardened kernel
Summary: net-libs/nodejs-0.4.7 denied RWX mmap on hardened kernel
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal major with 1 vote (vote)
Assignee: Patrick Lauer
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-20 09:47 UTC by Marcin Mirosław
Modified: 2012-01-17 09:13 UTC (History)
5 users (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 Marcin Mirosław 2011-05-20 09:47:08 UTC
$ node
FATAL ERROR: v8::Debug::SetDebugMessageDispatchHandler V8 is no longer usable

quote from dmesg:
[1980573.328197] grsec: From 10.8.2.125: denied RWX mmap of <anonymous mapping> by /usr/bin/node[node:8376] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[bash:8327] uid/euid:0/0 gid/egid:0/0

Reproducible: Always




# emerge --info
Portage 2.1.9.42 (hardened/linux/amd64, gcc-4.4.5, libc-0-r0, 2.6.37-hardened-r7 x86_64)
=================================================================
System uname: Linux-2.6.37-hardened-r7-x86_64-Intel-R-_Xeon-R-_CPU_E5504_@_2.00GHz-with-gentoo-1.12.14
Timestamp of tree: Fri, 20 May 2011 08:00:01 +0000
app-shells/bash:     4.1_p9
dev-lang/python:     2.7.1-r1, 3.1.3-r1
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
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.5
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
sys-kernel/linux-headers: 2.6.36.1
sys-libs/glibc:      2.11.3
virtual/os-headers:  0
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="pl en"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl amd64 bash-completion bzip2 cli cracklib crypt cups cxx device-mapper dri glibc-omitfp gpm hardened iconv idn justify mmap mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre pppd readline session slang smp snmp sse sse2 sse3 ssl ssse3 sysfs tcpd threads threadsafe unicode urandom xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul 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 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="braindump flow karbon kexi kpresenter krita tables words" 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 ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl en" NGINX_MODULES_HTTP="access auth_basic gzip gzip_static fastcgi realip rewrite stub_status" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Vlad Bokov 2011-06-12 12:05:33 UTC
I confirm the same error until 
# paxctl -m `which node`
and it works

# emerge --info
Portage 2.2.0_alpha33 (hardened/linux/amd64, gcc-4.5.1, glibc-2.12.1-r3, 2.6.36-hardened-r2 x86_64)
=================================================================
System uname: Linux-2.6.36-hardened-r2-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E6750_@_2.66GHz-with-gentoo-2.0.1
Timestamp of tree: Sun, 12 Jun 2011 10:15:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.3 [disabled]
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r2
dev-lang/python:          2.4.6, 2.5.4-r4, 2.6.6-r1, 3.1.2-r4
dev-util/ccache:          3.1.3
dev-util/cmake:           2.8.1-r2
sys-apps/baselayout:      2.0.1-r1
sys-apps/openrc:          0.6.4
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.4_p6-r1, 1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:       2.20.1-r1
sys-devel/gcc:            4.3.2-r3, 4.4.2, 4.5.1
sys-devel/gcc-config:     1.4.1
sys-devel/libtool:        2.4
sys-devel/make:           3.82
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.12.1-r3
Repositories: gentoo matsuu python luke-jr sunrise kde rion tante wirelay akoya hardened-dev voip mozilla local
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.2/ext-active/ /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.2/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.2/ext-active/ /etc/php/cli-php5.3/ext-active/ /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"
DISTDIR="/usr/distfiles"
FEATURES="assume-digests distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv"
FFLAGS=""
GENTOO_MIRRORS="http://mirror.yandex.ru"
LANG="ru_RU.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="ru"
MAKEOPTS="-j1"
PKGDIR="/usr/packages"
PORTAGE_CONFIGROOT="/"
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="/home/layman/matsuu /home/layman/python /home/layman/luke-jr /home/layman/sunrise /home/layman/kde /home/layman/rion /home/layman/tante /home/layman/wirelay /home/layman/akoya /home/layman/hardened-development /home/layman/voip /home/layman/mozilla /home/portage"
SYNC="rsync://mirror.yandex.ru/gentoo-portage"
USE="7zip X a52 aac aalib acl acpi additions aften alsa amarok amd64 amrnb amuled apache2 apm archive asf audiofile avi bash-completion bcmath binary-drivers bitmap-fonts bzip2 c++ cairo ccache cdda cddb cdinstall cdparanoia cdr cdrom cdsound chm chroot cisco cli colordiff connectionstatus contactnotes cpio cpudetection cracklib cscope css ctype cups curl curlwrappers cviewer cxx cyrillic dbus devil directfb divx divx4linux djvu dri dts dv dvb dvd dvdr dvdread dvi editor embedded enca encode esd espeak exif expat extensions fat fbcon fbsplash festival ffmpeg fftw firefox flac flash font-server fontconfig foomaticdb ftp games gd gdb gdbm gif gimp gimpprint git glitz gnuplot gnutls gphoto2 gpm graphite grub hardened hddtemp highlight history iconv icq id3tag ifp imagemagick imap imlib interbase iptv irc jabber java java6 javascript jpeg justify kcal kde kde4 kdecards kdepim kdm kdrive kig-scripting kipi kontact lame ldap lha libnotify libvisual libwww live lm_sensors logrotate magic maps matroska md5sum memlimit mikmod mime mjpeg mmx mng modplug modules mozilla mp2 mp3 mp4 mpeg mpeg2 mplayer mtp mudflap multilib musepack musicbrains musicbrainz mysql ncurses networkmanager nfs nls nptlonly ntfs numeric obex ogg oggvorbis opengl openmp openssl openvpn overlays pam pcntl pcre pda pdf pdflib perl php pink plasma pmu png portage posix postgres ppds pppd python qt3support qt4 query-browser quicktime rdesktop readline realmedia reiserfs rss rtc samba scanfolder search sensord session sharedext sharedmem simplexml skins slp smp sms smtp sndfile soap sockets solver sound sounds spamassassin speech speex spell sqlite sqlite3 srt sse sse2 ssl ssse3 statistics stats stream subtitles subversion svg svnserve symlink sysfs tcl tcpd texteffect tga theora thesaurus threads tiff translator transparency trayicon truetype type1 udev unicode upnp urandom usb utf8 v4l v4l2 vboxwebsrv vcd vhosts videos vim vim-pager vim-syntax vim-with-x visualization vnc vncviewer vorbis vorbis-psy weather webkit wmf wmp wxwindows x264 xcb xcomposite xforms xfs xft xml xorg xosd xpm xprint xrender xv xvid zip zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul 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 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="braindump flow karbon kexi kpresenter krita tables words" 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 ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru" LIRC_DEVICES="devinput tekram tekram_bt829" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="x86_64 i386" QEMU_USER_TARGETS="x86_64 i386" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon" 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, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 manwe 2011-07-24 17:50:44 UTC
Same thing for me, also paxctl -m helped. Maybe some info should be placed in ebuild's pkg_postinst()? 


Portage 2.1.10.6 (default/linux/amd64/10.0, gcc-4.5.2, glibc-2.13-r4, 2.6.39-hardened-r6-smaug-v2 x86_64)
=================================================================
System uname: Linux-2.6.39-hardened-r6-smaug-v2-x86_64-Intel-R-_Xeon-R-_CPU_E5506_@_2.13GHz-with-gentoo-2.0.3
Timestamp of tree: Sun, 24 Jul 2011 13:00:01 +0000
app-shells/bash:          4.2_p10
dev-lang/python:          2.7.1-r1
dev-util/cmake:           2.8.5
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.10.3, 1.11.1-r1
sys-devel/binutils:       2.21.1
sys-devel/gcc:            4.5.2
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.38 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Comment 3 Anthony Basile gentoo-dev 2011-08-12 00:52:45 UTC
strace -v node ends in a rwx mmap shortly after startup, somewhere around line 2352 of src/node.cc where calls to v8 are made.  There's probably some JIT code in there but there's no build option to turn it off.

I think the best option (bit of a security compromise however) is to add the pax markings.  Just add pax-mark -m "${D}"/usr/bin/node.

@Patrick, I can add and rev bump 0.4.{9,10} with your blessing.
Comment 4 Patrick Lauer gentoo-dev 2011-08-12 04:02:12 UTC
(In reply to comment #3) 
> I think the best option (bit of a security compromise however) is to add the
> pax markings.  Just add pax-mark -m "${D}"/usr/bin/node.
> 
> @Patrick, I can add and rev bump 0.4.{9,10} with your blessing.

Yes please :)
Comment 5 Tony Vroon (RETIRED) gentoo-dev 2012-01-17 08:53:21 UTC
Still an issue on net-libs/nodejs-0.6.7; same fix still applicable. Please action.
Comment 6 Tony Vroon (RETIRED) gentoo-dev 2012-01-17 09:13:18 UTC
+*nodejs-0.6.7-r1 (17 Jan 2012)
+
+  17 Jan 2012; Tony Vroon <chainsaw@gentoo.org> +nodejs-0.6.7-r1.ebuild:
+  Drop pax RWX mapping restrictions on hardened systems to avoid
+  (uninformative) start-up failure. Approved by Patrick "bonsaikitten" Lauer on
+  #gentoo-dev; fix suggested by Anthony "blueness" Basile in bug #368153.

My apologies for the delays incurred.