Gentoo Archives: gentoo-hardened

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

Replies

Subject Author
Re: [gentoo-hardened] hwclock and selinux (and other problems) Chris PeBenito <pebenito@g.o>