Bug 736153 - restorecon should not change USER,ROLE,MLS range unless -F is specified
restorecon should not change USER,ROLE,MLS range unless -F is specified
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: policycoreutils (Show other bugs)
6.1
All Linux
urgent Severity urgent
: rc
: 6.2
Assigned To: Daniel Walsh
Milos Malik
:
Depends On:
Blocks: RHEL62CCC 743047 846801 846802
  Show dependency treegraph
 
Reported: 2011-09-06 16:29 EDT by Daniel Walsh
Modified: 2013-02-25 08:39 EST (History)
8 users (show)

See Also:
Fixed In Version: policycoreutils-2.0.83-19.14.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-06 10:31:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Daniel Walsh 2011-09-06 16:29:35 EDT

    
Comment 4 Daniel Walsh 2011-09-13 14:13:57 EDT
Fixed in selinux-policy- 2.0.83-19.14
Comment 6 Milos Malik 2011-09-14 02:44:20 EDT
I'm correcting "Fixed In Version" field. More info in Changelog at https://brewweb.devel.redhat.com/buildinfo?buildID=179639.
Comment 7 Daniel Walsh 2011-09-15 10:29:29 EDT
Yes
Comment 14 Miroslav Vadkerti 2011-10-04 09:06:53 EDT
This bug is causing regressions (currently 2) but I really don't like this behaviour change:

See please:
https://bugzilla.redhat.com/show_bug.cgi?id=741430
https://bugzilla.redhat.com/show_bug.cgi?id=743222

Dan why do we need this fix. Is some customer behind this? Thanks!
Comment 15 Daniel Walsh 2011-10-04 10:06:13 EDT
Yes this fix was for MLS machines and soon will be needed for Targetd/Containers.

The idea is we want restorecon to fix the "type" portion of the label but not the level or the user, unless -F is given.  The current behaviour does not allow us to label a users homedirectory correctly if they are running at a level higher then s0.
Comment 16 Eduard Benes 2011-10-04 10:44:33 EDT
I believe this bug should be set back to ASSIGNED and we should discuss it
before including into RHEL 6.2. I have a couple of questions on my mind:

Does the change just move a part of previous default functionality to -F option? 
Is there a new functionality added to the -F option?
Could we keep the previous functionality and add a new option to take care of the requirement for labeling homedirs you've mentioned in previous comment?

The short summary is, that the new version of restorecon changes default
behaviour when used without -F option. With the new version one has to use -F
to get the same results as before. This is causing regressions as mentioned in
the previous comment in system scripts counting on the previous behaviour (not
mentioning possible issues in customer scripts).

OLD behaviour withOUT -F:
$ chcon -u staff_u -t shadow_t -l s0:c1 test ; ls -Z test ; restorecon -vv test
; ls -Z test
-rw-rw-r--. estragon estragon staff_u:object_r:shadow_t:s0:c1  test
restorecon reset /home/estragon/test context
staff_u:object_r:shadow_t:s0:c1->unconfined_u:object_r:user_home_t:s0
-rw-rw-r--. estragon estragon unconfined_u:object_r:user_home_t:s0 test

NEW behaviour withOUT -F:
# chcon -u staff_u -t shadow_t -l s0:c1 test ; ls -Z test ; restorecon -vv test
; ls -Z test
-rw-r--r--. root root staff_u:object_r:shadow_t:s0:c1  test
restorecon reset /root/test context
staff_u:object_r:shadow_t:s0:c1->staff_u:object_r:admin_home_t:s0:c1
-rw-r--r--. root root staff_u:object_r:admin_home_t:s0:c1 test

----

OLD behaviour WITH -F:
$ chcon -u staff_u -t shadow_t -l s0:c1 test ; ls -Z test ; restorecon -Fvv
test ; ls -Z test
-rw-rw-r--. estragon estragon staff_u:object_r:shadow_t:s0:c1  test
restorecon reset /home/estragon/test context
staff_u:object_r:shadow_t:s0:c1->unconfined_u:object_r:user_home_t:s0
-rw-rw-r--. estragon estragon unconfined_u:object_r:user_home_t:s0 test

NEW behaviour WITH -F:
# chcon -u staff_u -t shadow_t -l s0:c1 test ; ls -Z test ; restorecon -Fvv
test ; ls -Z test
-rw-r--r--. root root staff_u:object_r:shadow_t:s0:c1  test
restorecon reset /root/test context
staff_u:object_r:shadow_t:s0:c1->system_u:object_r:admin_home_t:s0
-rw-r--r--. root root system_u:object_r:admin_home_t:s0 test
Comment 22 errata-xmlrpc 2011-12-06 10:31:08 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1637.html

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