RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 599879 - autorelabel process leave system in permissive state
Summary: autorelabel process leave system in permissive state
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: initscripts
Version: 6.0
Hardware: All
OS: Linux
high
high
Target Milestone: beta
: ---
Assignee: initscripts Maintenance Team
QA Contact: Yulia Kopkova
URL:
Whiteboard:
: 592176 (view as bug list)
Depends On: 595823
Blocks: 524819 580448
TreeView+ depends on / blocked
 
Reported: 2010-06-03 20:44 UTC by Bill Nottingham
Modified: 2014-03-17 03:23 UTC (History)
16 users (show)

Fixed In Version: initscripts-9.03.8-3.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 595823
Environment:
Last Closed: 2010-07-02 19:11:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Bill Nottingham 2010-06-03 20:44:51 UTC
+++ This bug was initially created as a clone of Bug #595823 +++

initscripts-9.12-1.fc13.x86_64

# touch /.autorelabel
# reboot

Observe on the console:

...
dracut: Loading SELinux policy
type=1404 audit(1274809124.580:2): enforcing=1 old_enforcing=0 auid=4294967295 ses=4294967295
type=1403 audit(1274809124.948:3): policy loaded auid=4294967295 ses=4294967295
type=1404 audit(1274809124.954:4): enforcing=0 old_enforcing=1 auid=4294967295 ses=4294967295
...

*** Warning -- SELinux targeted policy relabel is required.
*** Relabeling could take a very long time, depending on file
*** system size and speed of hard drives.
***********************************************


# sestatus 
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   permissive
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

--- Additional comment from notting on 2010-05-25 14:01:05 EDT ---

enforcing needs to be off to ensure that autorelabeling works.

It will either reboot (which will go back to enforcing) or explicitly set it back to the prior state before continuing. See rc.sysinit for details.

--- Additional comment from chepkov on 2010-05-25 14:10:06 EDT ---

That what the reason for the bugzilla report
It does not set it back to enforcing after it's done

--- Additional comment from bucketofsnow on 2010-05-26 19:39:14 EDT ---

I can confirm this happens when "fixfiles onboot" is used as well.  The same result happens on my x86_64 system and i686 system. (Using either fixfiles onboot or touch /.autorelabel)

--- Additional comment from dwalsh on 2010-05-27 11:46:20 EDT ---

It is being caused by dracut.

In selinux-loadpolicy.sh  we have


	if [ $ret -eq 0 -o $ret -eq 2 ]; then
	    # If machine requires a relabel, force to permissive mode
	    [ -e "$NEWROOT"/.autorelabel ] && ( echo 0 > "$NEWROOT"/selinux/enforce )
	    return 0
	fi

Which causes the rc.sysinit to see it in permissive mode.

--- Additional comment from dwalsh on 2010-05-27 11:51:38 EDT ---

Having dracut set the permissive flag on boot helps in that if /bin/init is mislabeled of /lib and /usr/lib, apps will blow up before the restorecon starts.

But we need to tell init what the state of the box should be from dracut.

Or have the init script figure it out.

We need to check the kernel flag enforcing=0 and the enforcing flag in /etc/selinux/config and set it back to the proper state once the relabel finishes.

--- Additional comment from notting on 2010-05-27 11:58:24 EDT ---

Alternatively, we could have it *always* reboot. That's a hack, though.

--- Additional comment from dwalsh on 2010-05-27 13:27:49 EDT ---

Well actually that might be the correct behaviour, since way of knowing whether the rest of the machine was started correctly.   Of course you might end up in an infinite loop of reboots if the autorelabel=1 flag gets added to the /etc/grub.conf.

Comment 1 Bill Nottingham 2010-06-03 20:48:01 UTC
*** Bug 592176 has been marked as a duplicate of this bug. ***

Comment 2 RHEL Program Management 2010-06-03 21:03:18 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Bill Nottingham 2010-06-03 21:03:49 UTC
Marking as blocker as this hits the kdump path (see duplicate bug.)

Comment 4 Qian Cai 2010-06-07 08:56:10 UTC
*** Bug 597229 has been marked as a duplicate of this bug. ***

Comment 7 releng-rhel@redhat.com 2010-07-02 19:11:40 UTC
Red Hat Enterprise Linux Beta 2 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


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