Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 557350 - AdminCD Should enable "pax_softmode" kernel option
Summary: AdminCD Should enable "pax_softmode" kernel option
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: LiveCD/DVD/USB (show other bugs)
Hardware: AMD64 Linux
: Normal enhancement (vote)
Assignee: Gentoo Release Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-12 08:48 UTC by Russell Knighton
Modified: 2017-02-06 21:42 UTC (History)
0 users

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 Russell Knighton 2015-08-12 08:48:40 UTC
When trying to use the AdminCD to rescue another Linux installation, I was unable to run the necessary grub commands due to the grsecurity PaX hardening of the AdminCD kernel.

When running grub in the chrooted environment, I simply recieved error message "grub: asmstub.c:170: grub_stage2: Assertion `ret == 0' failed." And using an strace I can clearly see the mprotect: "permission denied" message.

There is seemingly no way around this because you can't disable PAX at boot because CONFIG_PAX_SOFTMODE isn't enabled.

In my opionion, it would make the AdminCD image even more useful when using it to rescue systems.

Reproducible: Always
Comment 1 Anthony Basile gentoo-dev 2015-08-12 11:04:07 UTC
I don't use the AdminCD so I need you to test.  Can you try adding pax_softmode=1 to the kernel command line parameters and see if that fixes things.
Comment 2 Russell Knighton 2015-08-12 11:28:25 UTC
I tried exactly that, but unfortunately it didn't work.

Having read the Kernel docs, my understanding is that you need to enable CONFIG_PAX_SOFTMODE option before that works, hence this bug/request. 

For reference, here is the kernel option description:

CONFIG_PAX_SOFTMODE:
Enabling this option will allow you to run PaX in soft mode, that
is, PaX features will not be enforced by default, only on executables
marked explicitly.  You must also enable PT_PAX_FLAGS or XATTR_PAX_FLAGS
support as they are the only way to mark executables for soft mode use.

Soft mode can be activated by using the "pax_softmode=1" kernel command
line option on boot.  Furthermore you can control various PaX features
at runtime via the entries in /proc/sys/kernel/pax.
Comment 3 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2016-07-30 12:35:47 UTC
https://gitweb.gentoo.org/proj/releng.git/commit/?id=cd39c541be8a039bc2f561364a7eedcee90e3285

This should be fixed in the next build.
Comment 4 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2016-11-13 20:01:31 UTC
Closing as we've built a few CDs since.
Comment 5 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2017-02-06 21:42:53 UTC
Seems I forgot to actually "close" the bug.