Gentoo Archives: gentoo-hardened

From: Tom Petri <tom.petri@××××××××××.com>
To: gentoo-hardened@l.g.o
Subject: Re: [gentoo-hardened] Setting filesystem labels for SELinux fails
Date: Tue, 20 Mar 2012 19:32:58
Message-Id: CAJg9FaT+UGwToL8qQgB712n75ExT7WC=EQSeNArFG2yP3JeRFg@mail.gmail.com
In Reply to: Re: [gentoo-hardened] Setting filesystem labels for SELinux fails by Tom Petri
1 On Sun, Mar 18, 2012 at 12:27 PM, Tom Petri <tom.petri@××××××××××.com> wrote:
2 > On Sun, Mar 18, 2012 at 11:36 AM, Sven Vermeulen <swift@g.o> wrote:
3 >> On Sun, Mar 18, 2012 at 10:36:53AM +0100, Tom Petri wrote:
4 >>> Yes, extended attributes along with security labels are activated.
5 >>>
6 >>> # attr -s test -V test /var && attr -r test /var
7 >>> Attribute "test" set to a 4 byte value for /var: test
8 >>>
9 >>> I should probably tell how I proceeded during the installation:
10 >>> 1. created the filesystems (as usual)
11 >>> 2. got a hardened stage3 tarball and portage
12 >>> 3. portage sync, re-emerge portage, created a hardened-sources kernel,
13 >>> booted up.
14 >>> 4. emerge policys (checkpolicy, policycoreutils, selinux-base-policy [-selinux])
15 >>> 5. emerge -uDN world
16 >>> 6. reboot and tried rlpkg -a -r
17 >>
18 >> Did the setfiles commands (mentioned in the installation instructions before
19 >> the "rlpkg -a -r") succeed, or did they give the same error?
20 >>
21 >> Wkr,
22 >>        Sven Vermeulen
23 >>
24 >>
25 >>
26 > Yes, I got the same errors then:
27 > # setfiles -r /mnt/gentoo
28 > /etc/selinux/strict/contexts/files/file_contexts /mnt/gentoo/dev
29 > setfiles set context /mnt/gentoo/dev->system_u:object_r:device_t
30 > failed:'Operation not supported'
31 > # setfiles -r /mnt/gentoo
32 > /etc/selinux/strict/contexts/files/file_contexts /mnt/gentoo/lib
33 > setfiles set context /mnt/gentoo/lib->system_u:object_r:lib_t
34 > failed:'Operation not supported'
35 I just did a fresh gentoo install (configuration) and proceeded with
36 the instructions from the gentoo hardened documentation.
37 After compiling re-emerging world the system doesn't get up. I'm able
38 to ping it but udev seems to have problems as /dev/console and the
39 tty's aren't found:
40
41 /etc/init.d/sshd[1205]: ERROR: sshd failed to start
42 /etc/init.d/urandom[1219]: ERROR: urandom failed to start
43 init: open(/dev/console): No such file or directory
44 agetty[1233]: /dev/tty2: not a character device
45 agetty[1232]: /dev/tty1: not a character device
46
47 My mdadm RAID is recognized properly, in case it matters.
48
49 I did everything the instructions say, however I'm always getting new
50 errors. Is there a viable solution to this? Thanks in advance!

Replies

Subject Author
Re: [gentoo-hardened] Setting filesystem labels for SELinux fails Tom Petri <tom.petri@××××××××××.com>