Gentoo Archives: gentoo-hardened

From: Chris PeBenito <pebenito@g.o>
To: gentoo-hardened@l.g.o
Subject: Re: [gentoo-hardened] hwclock and selinux (and other problems)
Date: Mon, 21 Apr 2008 01:38:58
Message-Id: 1208741934.5307.8.camel@defiant.pebenito.net
In Reply to: Re: [gentoo-hardened] hwclock and selinux (and other problems) by "François Valenduc"
1 On Sun, 2008-04-20 at 17:58 +0200, François Valenduc wrote:
2 > François Valenduc a écrit :
3 > > Chris PeBenito a écrit :
4 > >> On Sun, 2008-04-20 at 12:12 +0200, François Valenduc wrote:
5 > >>
6 > >>> xake@×××××××××.net a écrit :
7 > >>>
8 > >>>>> type=1400 audit(1208682664.167:223): avc: denied { read write } for
9 > >>>>> pid=29607 comm="hwclock" path="/var/log/faillog" dev=dm-6 ino=271083
10 > >>>>> scontext=root:system_r:hwclock_t tcontext=system_u:object_r:faillog_t
11 > >>>>> tclass=file
12 > >>>>>
13 > >>>> This is just an error about hwclock being unable to write to
14 > >>>> "faillog" so
15 > >>>> there must be something that goes wrong (making hwclock want to
16 > >>>> write to
17 > >>>> faillog).
18 > >>>>
19 > >>>>
20 > >>>>> I also got this error:
21 > >>>>> type=1400 audit(1208679707.497:84): avc: denied { read } for
22 > >>>>> pid=18454 comm="hwclock" path="/dev/urandom" dev=tmpfs ino=2059
23 > >>>>> scontext=root:system_r:hwclock_t
24 > >>>>> tcontext=system_u:object_r:urandom_device_t tclass=chr_file
25 > >>>>>
26 > >>>>> However, I think I solved it by issuing the commands "setsebool -P
27 > >>>>> global_ssp 1" and "load_policy"
28 > >>>>>
29 > >>>> This is becouse you have the hardened toolchain, compiling
30 > >>>> everything with
31 > >>>> PIE/SSP by default. SSP want a random number (picked from
32 > >>>> /dev/urandom)
33 > >>>> when the binaries start. SELinux disables access to urandom per
34 > >>>> default so
35 > >>>> you have to (as you did with sebool) tell SELinux that your system is
36 > >>>> compiled with SSP and thus the access to urandom should be permitted.
37 > >>>>
38 > >>>>
39 > >>> Yes, this has been solved with sebool. However, I still got the
40 > >>> second error (related to faillog). It also blocks distccd like this:
41 > >>> (even if the corresponding selinux policy is loaded):
42 > >>> type=1400 audit(1208681304.633:191): avc: denied { read write }
43 > >>> for pid=27886 comm="distccd" path="/var/log/faillog" dev=dm-6
44 > >>> ino=271083 scontext=root:system_r:distccd_t
45 > >>> tcontext=system_u:object_r:faillog_t tclass=file
46 > >>>
47 > >>> Do you know how to solve this second type of errors ?
48 > >>> Thanks for your help.
49 > >>>
50 > >>
51 > >> Seems weird that either of these programs would be writing to faillog,
52 > >> since that file is usually for logging login failures. Do you have any
53 > >> idea why this might be happening on your system?
54 > >>
55 > >>
56 > >
57 > > I also get other denials related to these two programs:
58 > >
59 > > type=1400 audit(1208708112.397:275): avc: denied { read } for
60 > > pid=1935 comm="distccd" path="pipe:[15699]" dev=pipefs ino=15699
61 > > scontext=user_u:system_r:distccd_t
62 > > tcontext=system_u:system_r:local_login_t tclass=fifo_file
63 > >
64 > > type=1400 audit(1208707984.676:266): avc: denied { read } for
65 > > pid=16744 comm="hwclock" path="pipe:[15699]" dev=pipefs ino=15699
66 > > scontext=user_u:system_r:hwclock_t
67 > > tcontext=system_u:system_r:local_login_t tclass=fifo_file
68 > >
69 > > Maybe this is the real reason for the failure of these two programs.
70 > >
71 > > François Valenduc
72 > Finally I managed to get hwclock working. I am using LVM and I forgot to
73 > install the corresponding policy. I didn't notice that it had not been
74 > installed when I ran "emerge --newuse world" (after having switched to
75 > the selinux profile). I also managed to get distcc working but only if I
76 > use the "listen" options in "/etc/conf.d/distccd'. If I use "allow"
77 > instead of "listen" to specify the authorized ip adresses, I get this error:
78 >
79 > type=1400 audit(1208706789.868:111): avc: denied { read write } for
80 > pid=9304 comm="distccd" name="3" dev=devpts ino=5
81 > scontext=root:system_r:distccd_t tcontext=root:object_r:sshd_devpts_t
82 > tclass=chr_file
83 > type=1400 audit(1208706789.879:112): avc: denied { ioctl } for
84 > pid=9304 comm="distccd" path="/dev/pts/3" dev=devpts ino=5
85 > scontext=root:system_r:distccd_t tcontext=root:object_r:sshd_devpts_t
86 > tclass=chr_file
87
88 Can you paste the output of `sestatus -v`?
89
90 --
91 Chris PeBenito
92 <pebenito@g.o>
93 Developer,
94 Hardened Gentoo Linux
95
96 Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE6AF9243
97 Key fingerprint = B0E6 877A 883F A57A 8E6A CB00 BC8E E42D E6AF 9243

Attachments

File name MIME type
signature.asc application/pgp-signature