Gentoo Archives: gentoo-hardened

From: Sven Vermeulen <swift@g.o>
To: gentoo-hardened@l.g.o
Subject: Re: [gentoo-hardened] SeLinux system_u:system_r:initrc_t inside KDE
Date: Sun, 14 Aug 2011 13:27:49
Message-Id: 20110814132715.GA23212@gentoo.org
In Reply to: Re: [gentoo-hardened] SeLinux system_u:system_r:initrc_t inside KDE by Mike Edenfield
1 On Sun, Aug 14, 2011 at 09:02:43AM -0400, Mike Edenfield wrote:
2 > It fixed my KDM logins to be unconfined, but it appears to break a bunch of
3 > other things:
4 >
5 > kutulu@platypus ~ $ id -Z
6 > unconfined_u:unconfined_r:unconfined_t
7 > kutulu@platypus ~ $ sudo -s
8 > Password:
9 > platypus kutulu # id -Z
10 > unconfined_u:unconfined_r:bootloader_t
11 >
12 > bootloader_t seems pretty random so its possible I screwed up my policy in
13 > some unrelated way. I'm reinstalling all the policy packages and
14 > relabeling, we'll see what happens.
15
16 This is usually the sign that the default context for the SELinux user (in
17 your case "unconfined_u") isn't set properly or that there is an issue with
18 it.
19
20 When I look at the default context information, I notice that there is none
21 for kdm_t (there is for xdm_t though):
22
23 ~# grep xdm_t /etc/selinux/strict/contexts/default_contexts
24 system_r:xdm_t user_r:user_t staff_r:staff_t sysadm_r:sysadm_t unconfined_r:unconfined_t
25
26 Since you work with unconfined, you'll need to use
27 /etc/selinux/targeted/contexts of course.
28
29 To find out if the initial context is set correctly, you can use getseuser:
30
31 ~# getseuser swift system_u:system_r:xdm_t
32 seuser: staff_u, level (null)
33 Context 0 staff_u:staff_r:staff_t
34
35 When I try it with kdm_t, I get an incorrect result as well (in my case, it
36 would use sysadm_t which is definitely not something I would like to happen
37 ;-)
38
39 Wkr,
40 Sven Vermeulen