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: Wed, 29 May 2013 01:29:10
Message-Id: 51A559E0.2030008@opensource.dyc.edu
In Reply to: [gentoo-hardened] Python stops working after upgrade by "Tóth Attila"
1 On 05/28/2013 07:46 PM, "Tóth Attila" wrote:
2 > I didn't laugh my ass ofter after discovering that python stopped working
3 > after upgrade. Especially since the package management system depends on a
4 > working python instance.
5 > Right after emerging python-2.7.5:
6 > paxctl-ng -v /usr/bin/python2.7
7 > /usr/bin/python2.7:
8 > PT_PAX : -E---
9 > XATTR_PAX : not found
10 >
11 > Let's put there the missing "m":
12 > paxctl-ng -m /usr/bin/python2.7
13 >
14 > Check back:
15 > paxctl-ng -v /usr/bin/python2.7
16 > /usr/bin/python2.7:
17 > PT_PAX : -Em--
18 > XATTR_PAX : -em--
19 >
20 > If PT_PAX has E, python2.7 would not start on my system.
21 > Let's correct that:
22 > paxctl-ng -e /usr/bin/python2.7
23 >
24 > Check back:
25 > paxctl-ng -v /usr/bin/python2.7
26 > /usr/bin/python2.7:
27 > PT_PAX : -em--
28 > XATTR_PAX : -em--
29 >
30 > Now python works again.
31 >
32 > What should I properly configure the above mentioned behavior? Is it just
33 > my system?
34
35 Something changed in the latest python upgrades because I'm having
36 problems of a different nature. I'll have to investigate.
37
38
39 >
40 > I keep the habit of creating regular binary package archives.
41 >
42 > In the mean time, freshly installed firefox binary is correct:
43 > paxctl-ng -v /usr/lib64/firefox/bin/firefox
44 > /usr/lib64/firefox/bin/firefox:
45 > PT_PAX : -em--
46 > XATTR_PAX : -em--
47 >
48 > Sidenote:
49 > Even after running migrate-pax -m, there are binaries on the system having
50 > only PT_PAX marking. Example:
51 > migrate-pax -m
52 > paxctl-ng -v /usr/bin/clear
53 > /usr/bin/clear:
54 > PT_PAX : -e---
55 > XATTR_PAX : not found
56 >
57 > Is that expected?
58
59 Unfortunately it is very difficult to find everything that links against
60 everything on a system. First there's just a simple logistic problem,
61 going through all ELF on a system and running ldd (or readelf -d) is
62 time consuming and likely to miss stuff. On gentoo with portage (not
63 paludis!) we have linkage info in NEEDED.ELF.2 in vdb created at build
64 time by examing linkage info, but this also can't be everything.
65 Consider plugins that dlopen-ed at runtime.
66
67 So something will be missed.
68
69 BUT!
70
71 That's not what's happening there. No XATTR_PAX flags implies the
72 default markings which is "-e---". This is so we don't have to go
73 around creating xattrs on every ELF binary on your system just to get
74 the default. Upstream wanted it that way and it does make sense.
75
76 Hope that makes sense.
77
78 >
79 > Regards:
80 > Dw.
81 >
82
83
84 --
85 Anthony G. Basile, Ph. D.
86 Chair of Information Technology
87 D'Youville College
88 Buffalo, NY 14201
89 (716) 829-8197

Replies

Subject Author
Re: [gentoo-hardened] Python stops working after upgrade "Tóth Attila" <atoth@××××××××××.hu>
Re: [gentoo-hardened] Python stops working after upgrade PaX Team <pageexec@××××××××.hu>