Bug 713417 - /root is labelled system_u:object_r:default_t:s0 after switching to MLS
Summary: /root is labelled system_u:object_r:default_t:s0 after switching to MLS
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: doc-Deployment_Guide
Version: 5.7
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Martin Prpič
QA Contact: ecs-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-15 11:21 UTC by Milos Malik
Modified: 2013-01-08 17:09 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-08 17:09:23 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Milos Malik 2011-06-15 11:21:22 UTC
Description of problem:

Version-Release number of selected component (if applicable):
selinux-policy-2.4.6-311.el5
selinux-policy-targeted-2.4.6-311.el5
selinux-policy-mls-2.4.6-311.el5

How reproducible:
always

Steps to Reproduce:
1. get a fresh RHEL-5.7 machine with targeted policy installed
2. log in via console as root
3. yum -y install selinux-policy\* policycoreutils\*
4. replace "SELINUXTYPE=targeted" with "SELINUXTYPE=mls" in /etc/selinux/config
5. add "single enforcing=0" to /boot/grub/grub.conf
6. touch /.autorelabel
7. reboot
8. wait until the machine boots to single-user mode
# sestatus 
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   permissive
Mode from config file:          enforcing
Policy version:                 21
Policy from config file:        mls
# matchpathcon /root
/root	system_u:object_r:default_t:s0
# restorecon -Rv /root
# ls -dZ /root
drwxr-x---  root root system_u:object_r:default_t:s0   root
#

Actual results:
/root is labelled default_t

Expected results:
/root is labelled sysadm_home_dir_t 

Additional information:
The problem is not tied to single-user mode, you can boot directly to runlevel 3 or 5 and you will see the same picture. Everything gets fine as soon as I run "genhomedircon ; restorecon -Rv /root" manually.

Comment 1 Daniel Walsh 2011-06-15 12:58:06 UTC
I think we have to add this to the docs for MLS.  Not sure how we can fix it other then the user running genhomedircon after switching to mls policy.

I would state it as 

After relabeling run

#genhomedircon
# restorecon -R -v /root /home  ANYOTHERHOMEDIRS

Comment 3 Douglas Silas 2012-01-25 14:54:41 UTC
Sorry, I meant to shout if I shoutn't...

Comment 4 RHEL Program Management 2012-04-02 11:20:42 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 8 Martin Prpič 2012-08-22 12:39:24 UTC
Moving to ON_QA. Added an "Enabling MLS in SELinux" which includes an extra step (#6) that was requested do be documented in this bug.


Note You need to log in before you can comment on or make changes to this bug.