Gentoo Archives: gentoo-hardened

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-hardened@l.g.o
Subject: Re: [gentoo-hardened] Grsec X11 Rbac Selinux Priviledged/Raw I/O Mprotect Firefox
Date: Mon, 07 Nov 2011 12:25:06
Message-Id: 4EB7CDF0.10109@gentoo.org
In Reply to: [gentoo-hardened] Grsec X11 Rbac Selinux Priviledged/Raw I/O Mprotect Firefox by Kevin Chadwick
1 On 11/06/2011 06:19 PM, Kevin Chadwick wrote:
2 > I've been using OpenBSD for a while now which has priv dropping X and
3 > the machdep.allowaperture=[0|1|2]. Theo has said firefox also
4 > annoyingly uses it's own memory management.
5
6 Hi, I've run many an OpenBSD boxes in my time.
7
8 Regarding Xorg. We do not drop privileges, that might be a good idea.
9 However, our X runs with almost full privileges. All toolchain
10 hardening is on except bind now. On the kernel side, X will run with
11 all hardening with the possible exception of CONFIG_GRKERNSEC_IO. If
12 you can run RBAC, it will help protect against rogue processes trying to
13 do iopl/ioperm calls.
14
15 As for firefox, I think Theo is referring to its built in malloc (I
16 forget what its called). I remember it causing problems, but not the
17 details. It may be related to its JIT which needs MPROTECT turned off
18 to run properly.
19
20 >
21 > I have a few questions about Grsec that I'd love some input on as I am
22 > struggling to find the answers to them at the moment.
23 >
24 > I've read on the Gentoo-hardened archive and grsec config help that the
25 > iopl and ioperm should be protected with rbac if priviledged I/O is
26 > allowed.
27 >
28 > So you can disable the RAW_IO capability to all and sacrifice xrestarts.
29 > But if X already has all priviledges then I guess your just adding a
30 > hurdle which is made a bit higher with grsec, so obfuscation really
31 > and not complete security. Is there anything else you can do or is that
32 > what is meant by "You should use RBAC if you allow priviledged I/O"?
33
34 I would try running it with CONFIG_GRKERNSEC_IO set and see if it works.
35 Try nvidia with nouveau driver, if you have that. My guess is
36 proprietary drivers are going to get you in trouble here, so if you have
37 an ATI, you may have no choice in the matter.
38
39 >
40 > The gentoo-handbook says something like the question of selinux|rbac|
41 > rsbac is a controversial one. It seems rsbac is the most secure but
42 > more difficult to use and has less starter policies around. Gentoo
43 > seems to have selinux policies. Does selinux have any more to offer than
44 > rbac for protecting X?
45
46 Its recommended that with workstations you run SELinux in targeted mode,
47 not strict. So, while it might offer something more for X (and I'm not
48 sure it does), this means loosening other restrictions that RBAC would
49 give you on a workstation.
50
51 >
52 > Does CONFIG_PAX_MPROTECT_COMPAT have any effect on firefox and did
53 > mozilla refuse to patch their sources with the if !jit patch?
54 >
55 > Thanks
56 >
57 > Kc
58
59
60 --
61 Anthony G. Basile, Ph.D.
62 Gentoo Linux Developer [Hardened]
63 E-Mail : blueness@g.o
64 GnuPG FP : 8040 5A4D 8709 21B1 1A88 33CE 979C AF40 D045 5535
65 GnuPG ID : D0455535