Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 447894 - Base policy does not load by default
Summary: Base policy does not load by default
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: SELinux (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: SE Linux Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-20 02:46 UTC by schmitt953
Modified: 2013-01-13 15:55 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description schmitt953 2012-12-20 02:46:36 UTC
This has happened on multiple occasions. I followed the doc and it does not load I keep having to load the base policy with cd /usr/share/selinux/mcs/ && semodule -b base.pp -i $(ls *.pp |grep -v base.pp) the same thing happens with strict. Perhaps we should add this line to the doc.
Comment 1 schmitt953 2012-12-20 02:49:41 UTC
Actually on mcs that doesn't work.
Comment 2 schmitt953 2012-12-20 02:51:06 UTC
I get this error when I do something like ./sshd restart
Exec:: No such file or directory
Comment 3 schmitt953 2012-12-20 03:42:17 UTC
Somehow after running semodule -n -B && ldd /sbin/init I got that as my denial message.

Dec 19 17:41:05 zeus kernel: [ 2727.420844] type=1400 audit(1355956865.592:25): avc:  denied  { search } for  pid=2442 comm="rc" name="1" dev="proc" ino=2053 ipaddr=137.112.116.221 scontext=root:sysadm_r:run_init_t:s0-s0:c0.c1023 tcontext=system_u:system_r:init_t:s0 tclass=dir
ng
Comment 4 schmitt953 2012-12-20 03:44:26 UTC
Dec 19 17:44:23 zeus kernel: [ 2925.755099] type=1400 audit(1355957063.925:26): avc:  denied  { read } for  pid=2446 comm="rc" name="environ" dev="proc" ino=2054 ipaddr=137.112.116.221 scontext=root:sysadm_r:run_init_t:s0-s0:c0.c1023 tcontext=system_u:system_r:init_t:s0 tclass=file
Dec 19 17:44:23 zeus kernel: [ 2925.755144] type=1400 audit(1355957063.925:27): avc:  denied  { open } for  pid=2446 comm="rc" path="/proc/1/environ" dev="proc" ino=2054 ipaddr=137.112.116.221 scontext=root:sysadm_r:run_init_t:s0-s0:c0.c1023 tcontext=system_u:system_r:init_t:s0 tclass=file
Dec 19 17:44:23 zeus kernel: [ 2925.755207] type=1400 audit(1355957063.925:28): avc:  denied  { getattr } for  pid=2446 comm="rc" path="/proc/1/environ" dev="proc" ino=2054 ipaddr=137.112.116.221 scontext=root:sysadm_r:run_init_t:s0-s0:c0.c1023 tcontext=system_u:system_r:init_t:s0 tclass=file

I guess there were 3 simultaneous errors
Comment 5 Sven Vermeulen (RETIRED) gentoo-dev 2012-12-20 08:37:58 UTC
You're mixing a lot of things which makes it hard to know what the problem is.

You state that the base policy doesn't load. What do you get? Any errors on the screen? If you clear your avc log, install the base policy and then check the avc denials, which ones do you get?

What is the output of sestatus?
Comment 6 schmitt953 2012-12-23 05:48:37 UTC
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             mcs
Current mode:                   permissive
Mode from config file:          permissive
Policy MLS status:              enabled
Policy deny_unknown status:     denied
Max kernel policy version:      28
Comment 7 schmitt953 2012-12-23 05:52:36 UTC
That was strange, I made it enforcing, relabeled, rebuilt the policies and it worked somehow. No clue how it happened.
Comment 8 schmitt953 2012-12-23 05:55:15 UTC
Disregard that last post, I was in permissive with the wrong role so it just went through (but no avc error?) when enforcing permission was denied thankfully
Comment 9 schmitt953 2012-12-23 07:03:30 UTC
It seems to work now except that for init scripts I have to do the full path when running them such as /etc/init.d/sshd restart instead of ./sshd restart which gives me Exec:: No such file or directory as an error.
Comment 10 Sven Vermeulen (RETIRED) gentoo-dev 2012-12-23 12:29:31 UTC
The "Exec::" error isn't related to switching base policy; I have that on all systems. Not sure if this is by design or not.

I'll create a bug for that to track. Any problems related to switching the policy types?
Comment 11 Sven Vermeulen (RETIRED) gentoo-dev 2012-12-23 12:33:47 UTC
Exec issue reported as bug #448292
Comment 12 schmitt953 2012-12-23 17:04:51 UTC
I guess it may be for another reason than what it was when I was using strict.
Comment 13 Sven Vermeulen (RETIRED) gentoo-dev 2013-01-13 15:55:36 UTC
Ok going to close this one as invalid