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 1013195 - When rhn_check initiates reboot, shutdown runs with incorrect SELinux context
Summary: When rhn_check initiates reboot, shutdown runs with incorrect SELinux context
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: sat560-triage
TreeView+ depends on / blocked
 
Reported: 2013-09-28 08:37 UTC by Jan Hutař
Modified: 2015-07-22 07:07 UTC (History)
11 users (show)

Fixed In Version: selinux-policy-3.7.19-265.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-22 07:07:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1375 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2015-07-20 18:07:47 UTC

Description Jan Hutař 2013-09-28 08:37:54 UTC
Description of problem:
When rhn_check initiates reboot, shutdown.pid file is created with incorrect SELinux context


Version-Release number of selected component (if applicable):
rhn-client-tools-1.0.0.1-8.el6.noarch
selinux-policy-targeted-3.7.19-195.el6_4.12.noarch
upstart-0.6.5-12.el6_4.1.x86_64


How reproducible:
always


Steps to Reproduce:
1. Use Satellite to initiate remote reboot on the system
2. # rhn_check
3. # ls -alZ /var/run/shutdown.pid
-rw-r--r--. root root unconfined_u:object_r:rpm_var_run_t:s0 /var/run/shutdown.pid
4. # ps axZ | grep shutdown
unconfined_u:system_r:rpm_t:s0-s0:c0.c1023 29597 pts/0 S   0:00 /sbin/shutdown -r +3
unconfined_u:system_r:rpm_t:s0-s0:c0.c1023 29598 pts/0 Z   0:00 [shutdown] <defunct>
5. # shutdown -c
shutdown: Shutdown is not running


Actual results:
You can not stop shutdown initiated by Satellite/rhn_check with `shutdown -c`.

Workaround is easy though: `killall shutdown`.


Expected results:
You should be able to stop shutdown initiated by Satellite/rhn_check with `shutdown -c`.


Additional info:
IMO not a 560 blocker. Maybe this is shutdown or SELinux policy issue?

Comment 1 Jan Hutař 2013-09-28 08:48:56 UTC
This does not happen on RHEL5.

rhn-client-tools-0.4.20.1-6.el5
selinux-policy-targeted-2.4.6-346.el5
SysVinit-2.86-17.el5

Comment 3 Milan Zázrivec 2013-10-01 13:25:32 UTC
Is this a regression from RHEL-6.3?

Comment 4 Jan Hutař 2013-10-04 10:48:28 UTC
No, using RHEL-6.3 I see the same:

upstart-0.6.5-12.el6.x86_64

# ls -alZ /var/run/shutdown.pid
-rw-r--r--. root root unconfined_u:object_r:rpm_var_run_t:s0 /var/run/shutdown.pid
# ps axZ | grep shutdown
unconfined_u:system_r:rpm_t:s0-s0:c0.c1023 14032 pts/0 S   0:00 /sbin/shutdown -r +3
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 14036 pts/0 S+   0:00 grep shutdown
# shutdown -c
shutdown: Cannot find pid of running shutdown

Comment 5 Milan Zázrivec 2013-10-04 13:48:42 UTC
All right, I'm postponing this to RHEL-6.6

Comment 7 Matej Kollar 2015-03-04 11:14:03 UTC
This would be better handled as selinux-policy.

Comment 11 Miroslav Grepl 2015-04-01 08:42:21 UTC
Milos,
could you re-test it with 


$cat mypol.te
policy_module(mypol, 1.0)
require{
 type rpm_t;
}

shutdown_domtrans(rpm_t)

Comment 12 Milos Malik 2015-04-01 13:53:01 UTC
I'm not familiar with Satellite, but Jan can test it, right?

Comment 13 Miroslav Grepl 2015-04-12 09:46:52 UTC
commit 4ca661aa4513877395986c692da350e57fa5b04c
Author: Miroslav Grepl <mgrepl>
Date:   Sun Apr 12 11:46:28 2015 +0200

    Allow rhn_check running as rpm to domtrans to shutdown domain

Comment 18 errata-xmlrpc 2015-07-22 07:07:09 UTC
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.

https://rhn.redhat.com/errata/RHBA-2015-1375.html


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