Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 480290 - =net-libs/webkit-gtk-1.8.3-r201[jit] is preventing www-client/midori from starting on grsec without 'paxctl -m /usr/bin/midori'
Summary: =net-libs/webkit-gtk-1.8.3-r201[jit] is preventing www-client/midori from sta...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: XFCE Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-08 19:10 UTC by A. Person
Modified: 2013-08-11 08:20 UTC (History)
2 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 A. Person 2013-08-08 19:10:57 UTC
midori won't start with grsec without 'paxctl -m /usr/bin/midori'.  I believe this can be handled in the ebuild?

$ midori -g
Launching command: '/usr/bin/gdb' --batch -ex 'set print thread-events off' -ex run -ex 'set logging on /tmp/midori-user/gdb.bt' -ex 'bt' --return-child-result --args midori 
warning: Cannot call inferior functions, Linux kernel PaX protection forbids return to non-executable pages!
The configuration couldn't be loaded: No such file or directory

Program terminated with signal SIGKILL, Killed.
The program no longer exists.
No stack.
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2013-08-08 20:44:48 UTC
I would expect this to be a bug in net-libs/webkit-gtk again. Provide output of `emerge --info` and `emerge -pv midori webkit-gtk` so we don't have to guess.

CCing hardened@ plus gnome@ for net-libs/webkit-gtk

http://bugs.gentoo.org/show_bug.cgi?id=338561#c8

"Disabling executable memory protection in a browser is a pretty big deal, since it is usually the piece of software that is most exposed to external attacks.

I didn't find mmap calls in midori source, so it's probably a problem in webkit. I wonder is this is similar to this bug:
https://bugzilla.redhat.com/show_bug.cgi?id=516057

incidentally, /usr/bin/jsc also segfaults on hardened Gentoo, so it could be that Midori tries to unconditionally initialize javascript support. I will file a separate bug about jsc failure."
Comment 3 A. Person 2013-08-09 08:23:39 UTC
Thank you for looking into this.

# emerge -pv midori webkit-gtk
[ebuild   R   ~] www-client/midori-0.5.4  USE="deprecated unique -doc -gnome -nls (-webkit2) -zeitgeist" 0 kB
[ebuild   R    ] net-libs/webkit-gtk-1.8.3-r300:3  USE="geoloc gstreamer introspection jit spell webgl (-aqua) -coverage -debug -doc {-test} -webkit2" 0 kB

# emerge --info
Portage 2.1.12.2 (default/linux/amd64/13.0/desktop, gcc-4.6.3, glibc-2.15-r3, 3.10.5-hardened x86_64)
=================================================================
System uname: Linux-3.10.5-hardened-x86_64-Intel-R-_Core-TM-_i5-2467M_CPU_@_1.60GHz-with-gentoo-2.2
KiB Mem:     3344500 total,    187028 free
KiB Swap:    2097148 total,   2086968 free
Timestamp of tree: Thu, 08 Aug 2013 10:30:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.5, 3.2.5-r1
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo proaudio x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA MakeMKV-EULA AdobeFlash-11.x"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
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"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --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/pro-audio /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 archive berkdb branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif faac fam ffmpeg firefox flac fontconfig fortran fuse gdbm gif gphoto2 gpm gstreamer gtk hardened iconv ios jack jpeg lcms libnotify mad mmx mmxext mng modules mp3 mp4 mpeg mudflap multilib ncurses nptl nsplugin odf ogg opengl openmp pam pango pcre pdf png policykit ppds qt3support qt4 raw readline sdl session sna spell sse sse2 ssl ssse3 startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vaapi vim-syntax vorbis wxwidgets x264 xcb xml xv xvid zlib" ABI_X86="64" 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" 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 ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_US en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" 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, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2013-08-09 13:54:38 UTC
(In reply to A. Person from comment #3)
> [ebuild   R    ] net-libs/webkit-gtk-1.8.3-r300:3  USE="geoloc gstreamer
> introspection jit spell webgl (-aqua) -coverage -debug -doc {-test}
> -webkit2" 0 kB

Sorry, I should have said output of 'emerge -pv webkit-gtk:2' (because SLOT="2" is being used when USE="deprecated" is enabled in www-client/midori)
Comment 5 A. Person 2013-08-10 08:29:00 UTC
Not a problem:

# emerge -pv webkit-gtk:2
[ebuild   R    ] net-libs/webkit-gtk-1.8.3-r201:2  USE="geoloc gstreamer introspection jit spell webgl (-aqua) -coverage -debug {-test}" 0 kB
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2013-08-10 08:50:52 UTC
(In reply to A. Person from comment #5)
> Not a problem:
> 
> # emerge -pv webkit-gtk:2
> [ebuild   R    ] net-libs/webkit-gtk-1.8.3-r201:2  USE="geoloc gstreamer
> introspection jit spell webgl (-aqua) -coverage -debug {-test}" 0 kB

Can you try without USE="jit" ?  That is the flag that has caused problems in the past, and that would confirm this is a webkit-gtk bug.
Comment 7 A. Person 2013-08-11 06:00:46 UTC
You are correct, midori runs fine with 'paxctl -zex /usr/bin/midori' if I compile:

USE="-jit" emerge -1 webkit-gtk:2
Comment 8 Pacho Ramos gentoo-dev 2013-08-11 07:39:41 UTC
It's a known problem:
        # Build-time segfaults under PaX with USE="introspection jit", bug #404215
        if use introspection && use jit; then
                epatch "${FILESDIR}/${PN}-1.6.3-paxctl-introspection.patch"
                cp "${FILESDIR}/gir-paxctl-lt-wrapper" "${S}/" || die
        fi


Currently, the way to handle this is to make the marking only when the USE flag is set. You can read latest webkit-gtk and epiphany ebuilds as reference
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2013-08-11 07:56:48 UTC
(In reply to Pacho Ramos from comment #8)
> It's a known problem:
>         # Build-time segfaults under PaX with USE="introspection jit", bug
> #404215
>         if use introspection && use jit; then
>                 epatch "${FILESDIR}/${PN}-1.6.3-paxctl-introspection.patch"
>                 cp "${FILESDIR}/gir-paxctl-lt-wrapper" "${S}/" || die
>         fi
> 
> 
> Currently, the way to handle this is to make the marking only when the USE
> flag is set. You can read latest webkit-gtk and epiphany ebuilds as reference

epiphany's ebuild look like bad example, it has useless IUSE="jit" and [jit?] when it could do a has_version check instead

but okay, I'll restore pax-mark to the midori's ebuild
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2013-08-11 08:20:24 UTC
+  11 Aug 2013; Samuli Suominen <ssuominen@gentoo.org> midori-0.5.4.ebuild:
+  Restore pax marking of /usr/bin/midori because net-libs/webkit-gtk[jit] is
+  broken again wrt #480290 by "A. Person"

http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/midori/midori-0.5.4.ebuild?r1=1.1&r2=1.2