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 1144165 - SELinux: rhsmcertd-worke unable to write to /var/lib/rpm
Summary: SELinux: rhsmcertd-worke unable to write to /var/lib/rpm
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.0
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: 7.1
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-18 20:00 UTC by Richard Su
Modified: 2018-12-09 18:36 UTC (History)
5 users (show)

Fixed In Version: selinux-policy-3.13.1-9.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 10:41:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
audit.log (124.01 KB, application/octet-stream)
2014-09-18 20:00 UTC, Richard Su
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0458 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2015-03-05 15:17:00 UTC

Description Richard Su 2014-09-18 20:00:44 UTC
Created attachment 939029 [details]
audit.log

Description of problem:
rhsmcertd-worke is uanble to write to /var/lib/rpm. This happens after the an instack RHEL7 image is booted up the first time.

Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.12.1-153.el7_0.10.noarch
selinux-policy-3.12.1-153.el7_0.10.noarch
subscription-manager-1.10.14-9.el7_0.x86_64
rhnsd-5.0.13-3.el7.x86_64
rhnlib-2.5.65-2.el7.noarch
rhn-client-tools-2.0.2-5.el7.noarch
rhn-check-2.0.2-5.el7.noarch
rhn-setup-2.0.2-5.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. Create and boot an instack-undercloud RHEL7 image using https://github.com/agroup/instack-undercloud/blob/master/README-source.md

Actual results:
rhsmcertd-worke denials found in audit.log

Expected results:
No denials.

Additional info:

type=AVC msg=audit(1410984925.093:83): avc:  denied  { write } for  pid=887 comm="rhsmcertd-worke" name="rpm" dev="sda1" ino=1441954 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=unconfined_u:object_r:rpm_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1410984925.093:83): avc:  denied  { add_name } for  pid=887 comm="rhsmcertd-worke" name="__db.001" scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=unconfined_u:object_r:rpm_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1410984925.093:83): avc:  denied  { create } for  pid=887 comm="rhsmcertd-worke" name="__db.001" scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=file
type=AVC msg=audit(1410999261.157:138): avc:  denied  { write } for  pid=932 comm="rhsmcertd-worke" name="rpm" dev="sda1" ino=1441954 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=unconfined_u:object_r:rpm_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1410999261.157:138): avc:  denied  { add_name } for  pid=932 comm="rhsmcertd-worke" name="__db.001" scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=unconfined_u:object_r:rpm_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1410999261.157:138): avc:  denied  { create } for  pid=932 comm="rhsmcertd-worke" name="__db.001" scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=file
type=AVC msg=audit(1411065591.296:91): avc:  denied  { write } for  pid=906 comm="rhsmcertd-worke" name="rpm" dev="sda1" ino=1441954 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=unconfined_u:object_r:rpm_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1411065591.296:91): avc:  denied  { add_name } for  pid=906 comm="rhsmcertd-worke" name="__db.001" scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=unconfined_u:object_r:rpm_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1411065591.296:91): avc:  denied  { create } for  pid=906 comm="rhsmcertd-worke" name="__db.001" scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=file
type=AVC msg=audit(1411066510.056:162): avc:  denied  { dac_override } for  pid=1190 comm="rhsmcertd-worke" capability=1  scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:system_r:rhsmcertd_t:s0 tclass=capability
type=AVC msg=audit(1411066510.056:162): avc:  denied  { getattr } for  pid=1190 comm="rhsmcertd-worke" path="/home/stack/instack" dev="sda1" ino=918739 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir
[root@localhost audit]# find / -inum 1441954
/var/lib/rpm
[root@localhost audit]# ls -Z /var/lib/rpm
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Basenames
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Conflictname
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 __db.001
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 __db.002
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 __db.003
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Dirnames
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Group
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Installtid
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Name
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Obsoletename
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Packages
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Providename
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Requirename
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Sha1header
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Sigmd5
-rw-r--r--. root root unconfined_u:object_r:rpm_var_lib_t:s0 Triggername
[root@localhost audit]# ls -Z /var/lib/ | grep rpm
drwxr-xr-x. root      root     unconfined_u:object_r:rpm_var_lib_t:s0 alternatives
drwxr-xr-x. root      root     unconfined_u:object_r:rpm_var_lib_t:s0 rpm
drwxr-xr-x. root      root     system_u:object_r:var_lib_t:s0   rpm-state
drwxr-xr-x. root      root     unconfined_u:object_r:rpm_var_lib_t:s0 yum

Comment 2 Miroslav Grepl 2014-10-02 11:23:12 UTC
Did it work?

Comment 3 Richard Su 2014-10-07 05:51:02 UTC
I'm sorry, did what work?

Comment 6 Miroslav Grepl 2014-10-13 09:47:51 UTC
Your test scenario. Did it work in enforcing mode even AVC msgs.

Comment 8 Richard Su 2014-11-11 05:24:27 UTC
Will get back to you shortly. I'm in the middle of getting our tests to pass on RHEL.

Comment 9 Richard Su 2014-11-12 00:08:25 UTC
I finished my tests and having the denials didn't affect undercloud or overcloud deployment and tests.

Comment 10 Miroslav Grepl 2014-11-18 13:32:59 UTC
#============= rhsmcertd_t ==============

#!!!! This avc is allowed in the current policy
allow rhsmcertd_t rpm_var_lib_t:dir add_name;

#!!!! This avc is allowed in the current policy
allow rhsmcertd_t rpm_var_lib_t:file create;

#!!!! This avc is allowed in the current policy
allow rhsmcertd_t setroubleshootd_t:process signull;

Comment 14 errata-xmlrpc 2015-03-05 10:41: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-0458.html


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