Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 447150 - xt_pax need to be exactly same as pt_pax
Summary: xt_pax need to be exactly same as pt_pax
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 431092
  Show dependency tree
 
Reported: 2012-12-13 19:38 UTC by Amadeusz Sławiński
Modified: 2013-02-10 14:25 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 Amadeusz Sławiński 2012-12-13 19:38:24 UTC
On kernels with both XT_PAX and PT_PAX enabled you need consistent flags set by eclass
ie if you add to both 'm' it may be not enough as most binaries have in pt_pax 'e' by default

For example plugin-container hangs firefox due to conflicting flags:

# paxctl -v /usr/lib64/firefox/plugin-container
PaX control v0.7
Copyright 2004,2005,2006,2007,2009,2010,2011,2012 PaX Team <pageexec@freemail.hu>

- PaX flags: -----m-x-e-- [/usr/lib64/firefox/plugin-container]
	MPROTECT is disabled
	RANDEXEC is disabled
	EMUTRAMP is disabled
# getfattr -d /usr/lib64/firefox/plugin-container     
getfattr: Removing leading '/' from absolute path names
# file: usr/lib64/firefox/plugin-container
user.pax.flags="m"


After
# setfattr -n user.pax.flags -v "me" /usr/lib64/firefox/plugin-container 
firefox runs ok

Reproducible: Always
Comment 1 Anthony Basile gentoo-dev 2012-12-13 21:35:02 UTC
This should be fixed soon.  I have to update the pax-utils.eclass.  In the mean time you can help test!  Use the eclass at

http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=blob;f=eclass/pax-utils.eclass;h=e860d04b32bb301f447e385d3cb35129cff4e394;hb=38ad3d21b9fd281e326eff20ceb6de1ccb0ee1ef

and let me know if that fixes it for you.
Comment 2 Amadeusz Sławiński 2012-12-14 12:56:09 UTC
Yes I forgot to mention that, that's the one I use.
I uninstalled paxctl-ng (because it's broken) so it uses setfattr, which seems to work ok, except for not setting 'e' flag which is in pt_pax.
Comment 3 Anthony Basile gentoo-dev 2012-12-14 13:01:43 UTC
(In reply to comment #2)
> Yes I forgot to mention that, that's the one I use.
> I uninstalled paxctl-ng (because it's broken) so it uses setfattr, which
> seems to work ok, except for not setting 'e' flag which is in pt_pax.

paxctl-ng is work in progress.  Please let me what version you were using and how it was broken.

setfattr will not set the default flags for you, like e.  Hence the need for a tool like paxctl-ng.
Comment 4 Amadeusz Sławiński 2012-12-14 13:30:51 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Yes I forgot to mention that, that's the one I use.
> > I uninstalled paxctl-ng (because it's broken) so it uses setfattr, which
> > seems to work ok, except for not setting 'e' flag which is in pt_pax.
> 
> paxctl-ng is work in progress.  Please let me what version you were using
> and how it was broken.

version 0.6.0
It was already reported in bug 446518 (it puts '-' in flags)

> setfattr will not set the default flags for you, like e.  Hence the need for
> a tool like paxctl-ng.

Won't it cause binaries not working when they are marked on systems without paxctl-ng? Maybe it can copy pt_pax flags if present?
Comment 5 Anthony Basile gentoo-dev 2013-02-10 11:46:26 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > Yes I forgot to mention that, that's the one I use.
> > > I uninstalled paxctl-ng (because it's broken) so it uses setfattr, which
> > > seems to work ok, except for not setting 'e' flag which is in pt_pax.
> > 
> > paxctl-ng is work in progress.  Please let me what version you were using
> > and how it was broken.
> 
> version 0.6.0
> It was already reported in bug 446518 (it puts '-' in flags)
> 
> > setfattr will not set the default flags for you, like e.  Hence the need for
> > a tool like paxctl-ng.
> 
> Won't it cause binaries not working when they are marked on systems without
> paxctl-ng? Maybe it can copy pt_pax flags if present?

The eclass now takes care of that.  Its okay to allow the utility to have more flexibility than you want.  We'll the portage take care of making sure we correctly set the flags we need when installing.

I believe this is fixed in the latest version of the eclass.
Comment 6 Amadeusz Sławiński 2013-02-10 14:16:25 UTC
Yes, it's fixed, thanks.
Comment 7 Anthony Basile gentoo-dev 2013-02-10 14:25:14 UTC
Thanks!