Gentoo Archives: gentoo-hardened

From: "Anthony G. Basile" <basile@××××××××××××××.edu>
To: gentoo-hardened@l.g.o
Subject: Re: [gentoo-hardened] Python stops working after upgrade
Date: Thu, 30 May 2013 15:13:39
Message-Id: 51A76CA9.10109@opensource.dyc.edu
In Reply to: Re: [gentoo-hardened] Python stops working after upgrade by PaX Team
1 On 05/29/2013 07:55 PM, PaX Team wrote:
2 > On 28 May 2013 at 21:29, Anthony G. Basile wrote:
3 >
4 >> Unfortunately it is very difficult to find everything that links against
5 >> everything on a system. First there's just a simple logistic problem,
6 >> going through all ELF on a system and running ldd (or readelf -d) is
7 >> time consuming and likely to miss stuff. On gentoo with portage (not
8 >> paludis!) we have linkage info in NEEDED.ELF.2 in vdb created at build
9 >> time by examing linkage info, but this also can't be everything.
10 >> Consider plugins that dlopen-ed at runtime.
11 >
12 > PaX already has code for textrel handling where it looks at mapped libraries,
13 > it'd be easy to add detection for mismatched process vs. library PaX flags
14 > at the same time.
15 >
16 > let me know if you could use this (users would have to send you logs so that
17 > you can build a database or perhaps some tool run locally could do it for
18 > everyone) and i'll code it up.
19
20 Yes, that would be excellent! The kernel is the obvious place to catch
21 actual linkings rather than the sort of userland guesswork that I've
22 been grappling with. What might this exe dlopen next?
23
24 >
25 >> That's not what's happening there. No XATTR_PAX flags implies the
26 >> default markings which is "-e---".
27 >
28 > actually no pax.flags xattr on the file means that it'll be ignored and
29 > the other mechanisms will be used (which can ultimately be -e--- if no
30 > other mechanism is configured). now what you do in paxctl-ng is another
31 > matter, i thought that it'd keep these two flags in sync, at least when
32 > an already existing PT_PAX one is not the default value like it wasn't
33 > in his case (EMUTRAMP was on for softmode).
34 >
35
36 When marking PpEeMmRrSs with paxctl-ng, it does keep the two sets in
37 sync, although there are options that allow you to change one and not
38 the other and so desynchronize. But it goes out of its way, where it
39 can, to keep the two in sync.
40
41 migrate-pax also will copy PT_PAX to XATTR_PAX flags identically with
42 one exception, if PT_PAX = "-e---" then no user.pax.flags xattr is
43 created. I am always thinking in terms of either PAX_PT_PAX_FLAGS xor
44 PAX_XATTR_PAX_FLAGS is on, not both. When both are on, we fall back on
45 what you describe. So I adopted the approach: don't copy "-e---" to
46 XATTR_PAX and when you reboot into a PAX_PT_PAX_FLAGS=n and
47 PAX_XATTR_PAX_FLAGS=y kernel, you'll get the desired behavior.
48
49 A good approach or no?
50
51
52 --
53 Anthony G. Basile, Ph. D.
54 Chair of Information Technology
55 D'Youville College
56 Buffalo, NY 14201
57 (716) 829-8197

Replies

Subject Author
Re: [gentoo-hardened] Python stops working after upgrade Magnus Granberg <zorry@g.o>