Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 398941 - gnome-base/gnome-shell-3.2.1-r3 segfaults at startup on a hardened system
Summary: gnome-base/gnome-shell-3.2.1-r3 segfaults at startup on a hardened system
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: AMD64 Linux
: Normal critical (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-15 09:33 UTC by Orson Teodoro
Modified: 2012-01-25 08:45 UTC (History)
1 user (show)

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


Attachments
emerge --info (emerge-info.log,4.10 KB, text/plain)
2012-01-15 09:34 UTC, Orson Teodoro
Details
eselect mesa list (eselect-mesa.log,638 bytes, text/plain)
2012-01-15 09:35 UTC, Orson Teodoro
Details
emerge -pve gnome-light (emerge-gnome-light.log,30.85 KB, text/plain)
2012-01-15 09:36 UTC, Orson Teodoro
Details
dmesg for gnome-session (dmesg-gnome-session.log,3.56 KB, text/plain)
2012-01-15 09:36 UTC, Orson Teodoro
Details
dmesg for gnome-shell (dmesg-gnome-shell.log,763 bytes, text/plain)
2012-01-15 09:37 UTC, Orson Teodoro
Details
dmesg gnome-settings-daemon PAX termination (pax-gnome-settings-daemon.log,14.16 KB, text/plain)
2012-01-15 22:52 UTC, Orson Teodoro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Orson Teodoro 2012-01-15 09:33:49 UTC
Simply starting up gnome-shell/gnome-session doesn't start the desktop environment

Reproducible: Always

Steps to Reproduce:
1. nano .xinitrc
2a. exec gnome-session
2b. exec gnome-shell
3. startx
Actual Results:  
A blue pinstripe background shows but no desktop or panels

Expected Results:  
It should show the panels or desktop normally

gnome-base/gnome-shell-3.2.1-r3  USE="bluetooth networkmanager" 0 kB
sys-libs/glibc-2.13-r4  USE="hardened (multilib) nls -debug -gd -glibc-omitfp -profile (-selinux) -vanilla" 0 kB
Laptop with Intel HD Graphics
Comment 1 Orson Teodoro 2012-01-15 09:34:50 UTC
Created attachment 298979 [details]
emerge --info
Comment 2 Orson Teodoro 2012-01-15 09:35:34 UTC
Created attachment 298981 [details]
eselect mesa list
Comment 3 Orson Teodoro 2012-01-15 09:36:17 UTC
Created attachment 298983 [details]
emerge -pve gnome-light
Comment 4 Orson Teodoro 2012-01-15 09:36:48 UTC
Created attachment 298985 [details]
dmesg for gnome-session
Comment 5 Orson Teodoro 2012-01-15 09:37:19 UTC
Created attachment 298987 [details]
dmesg for gnome-shell
Comment 6 Orson Teodoro 2012-01-15 09:45:07 UTC
Emerge and tested gnome-shell with 1 and 5 and still fails
 [1] x86_64-pc-linux-gnu-4.5.3 *
 [2] x86_64-pc-linux-gnu-4.5.3-hardenednopie
 [3] x86_64-pc-linux-gnu-4.5.3-hardenednopiessp
 [4] x86_64-pc-linux-gnu-4.5.3-hardenednossp
 [5] x86_64-pc-linux-gnu-4.5.3-vanilla
Comment 7 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-01-15 13:34:18 UTC
First, please attach your ~/.xsession-errors file after the crash, it may contain useful information.

Second, this dmesg line
> grsec: denied RWX mmap of <anonymous mapping> by /usr/bin/gnome-shell[gnome-shell:29431] uid/euid:1000/1000 gid/egid:1000/1000, parent /usr/bin/xinit[xinit:29424] uid/euid:1000/1000 gid/egid:1000/1000
appears to indicate that your system is denying gnome-shell access to rwx memory that might be needed, for instance, for javascript jit (gnome-shell is largely written in javascript and uses mozilla's spidermonkey vm). That is almost certain to prevent gnome-shell from functioning properly, and might be the cause of your segfault.

Are there perhaps some special commands or configurations that are needed to allow rwx memory on hardened? (I frankly have no idea - neither I nor any of the other gentoo gnome team members run hardened systems.)
Comment 8 Orson Teodoro 2012-01-15 22:42:07 UTC
Executing

paxctl -m /usr/bin/gnome-shell 

gets rid of the libpthread error.  However, dmesg shows that are more tasks that PAX kills such as /usr/libexec/gnome-settings-daemon and it still doesn't load to the desktop environment within 5 sec.  I recompiled a kernel without grsecurity and pax and I can confirm that Gnome 3 works and loads quickly to the desktop, with code generated with pie and ssp gcc compiler.  I need recheck the pax markings on other files so Gnome 3 works properly with the hardened kernel.
Comment 9 Orson Teodoro 2012-01-15 22:52:16 UTC
Created attachment 299041 [details]
dmesg gnome-settings-daemon PAX termination

New error generated after paxctl -m /usr/bin/gnome-settings solves error in attachments 298985 and 298987
Comment 10 Orson Teodoro 2012-01-16 00:56:45 UTC
Okay I got the proper pax marking for the gnome-shell that it works normally with hardened kernel enabled grsecurity and pax enabled.  Executing

paxctl -z /usr/bin/gnome-shell    #restore defaults
paxctl -xemr /usr/bin/gnome-shell

fixes all the problems that I have been having.  Just disable RANDMMAP (-r) and disable MPROTECT (-m); xe were the original values.
Comment 11 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-01-21 02:07:45 UTC
Orson, thank you for your investigation. The gnome-shell-3.2.2.1 ebuild that I have just added to portage should automatically call paxctl to disable RANDMMAP and MPROTECT for /usr/bin/gnome-shell. Please verify that this really works and that you can run gnome-shell without needing to manually paxctl it.

@hardened, if 'pax-mark mr "${ED}usr/bin/gnome-shell"' in src_install() is the wrong way to go about this, please say something.

>*gnome-shell-3.2.2.1 (21 Jan 2012)
>
>  21 Jan 2012; Alexandre Rostovtsev <tetromino@gentoo.org>
>  -gnome-shell-3.2.1-r1.ebuild, -gnome-shell-3.2.1-r2.ebuild,
>  -files/gnome-shell-3.2.1-messageTray-reduce-fade.patch,
>  -files/gnome-shell-3.2.1-theme-lighten-sent-message.patch,
>  +gnome-shell-3.2.2.1.ebuild:
>  Bump, fixes lots of crashes, rendering errrors, and memory leaks (in network
>  menu, notifications, workspace thumbnails, icons, etc.) Also, mark
>  gnome-shell executable to allow running under hardened/PaX (bug #398941,
>  thanks to Orson Teodoro). Drop old.
Comment 12 Orson Teodoro 2012-01-22 00:06:24 UTC
Yes the gnome-shell-3.2.2.1.ebuild properly applies the pax markings and gnome-shell works properly.
Comment 13 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-01-25 08:45:42 UTC
The same change has also been applied to >=cinnamon-1.2, since it is a close fork of gnome-shell.