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 1716418 - [dhcpd] execute /lib64/libnss_sss.so.2 AVC denial
Summary: [dhcpd] execute /lib64/libnss_sss.so.2 AVC denial
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: resource-agents
Version: 7.7
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: rc
: ---
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1719684 1731426
TreeView+ depends on / blocked
 
Reported: 2019-06-03 13:03 UTC by Patrik Hagara
Modified: 2020-03-31 19:48 UTC (History)
8 users (show)

Fixed In Version: resource-agents-4.1.1-31.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1715844
: 1719684 1731426 (view as bug list)
Environment:
Last Closed: 2020-03-31 19:47:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ClusterLabs resource-agents pull 1352 0 None closed dhcpd: keep SELinux context 2020-04-01 14:24:28 UTC
Red Hat Product Errata RHBA-2020:1067 0 None None None 2020-03-31 19:48:00 UTC

Description Patrik Hagara 2019-06-03 13:03:43 UTC
+++ This bug was initially created as a clone of Bug #1715844 +++

Description of problem:

dhcpd daemon start produces the following AVC denial:

time->Fri May 31 13:57:32 2019
type=PROCTITLE msg=audit(1559303852.249:413): proctitle=6468637064002D6366002F746D702F646863702E636F6E66002D6368726F6F74002F7661722F6C69622F6468637064002D6C66002F64622F64686370642E6C6561736573002D75736572006468637064002D67726F7570006468637064002D7066002F7661722F72756E2F64686370642E7069640064756D6D7930
type=SYSCALL msg=audit(1559303852.249:413): arch=c000003e syscall=9 success=yes exit=140067871424512 a0=0 a1=208490 a2=5 a3=802 items=0 ppid=5987 pid=5988 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="dhcpd" exe="/usr/sbin/dhcpd" subj=system_u:system_r:dhcpd_t:s0 key=(null)
type=AVC msg=audit(1559303852.249:413): avc:  denied  { execute } for  pid=5988 comm="dhcpd" path="/lib64/libnss_sss.so.2" dev="dm-0" ino=5752596 scontext=system_u:system_r:dhcpd_t:s0 tcontext=system_u:object_r:dhcpd_state_t:s0 tclass=file permissive=1

the dhcpd service appears to work, but might be missing some features do to the above when selinux is in enforcing mode (default).

Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-249.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. install, configure and start dhcpd
2.
3.

Actual results:
daemon starts, AVC denial logged

Expected results:
no AVC denials

Additional info:

--- Additional comment from Milos Malik on 2019-05-31 14:37:49 UTC ---

The /lib64/libnss_sss.so.2 is mislabeled.

Correct label is:
# matchpathcon /lib64/libnss_sss.so.2
/lib64/libnss_sss.so.2	system_u:object_r:lib_t:s0
#

Following command will repair the problem:
# restorecon -Rv /lib64

--- Additional comment from Lukas Vrabec on 2019-06-03 11:49:45 UTC ---

Patrick, 

Could you please confirm that solution from comment#2 is working for you? 

Thanks,
Lukas.

--- Additional comment from Patrik Hagara on 2019-06-03 12:08:29 UTC ---

Actually, the bug appears to be on the cluster resource agent side -- I'm running this in as a pacemaker cluster resource, sorry for not mentioning that in the description.

The resource agent defaults to running dhcpd in a chroot and copies config files and required libraries (libnss_sss.so.2 among them) into the chroot [1]. The "-p/--preserve" option of `cp` does not appear to preserve selinux context of the copied files (unless it's explicitly requested) and so the AVCs occur.

IIUC, this should be fixed in the resource agent itself and not selinux-policy. Is that correct?


[1] https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/dhcpd#L331

--- Additional comment from Zdenek Pytela on 2019-06-03 12:57:55 UTC ---

I'd suggest including xattr into the preserved set or use all, see cp(1):

       -p     same as --preserve=mode,ownership,timestamps

       --preserve[=ATTR_LIST]
              preserve the specified attributes (default: mode,ownership,timestamps), if possi‐
              ble additional attributes: context, links, xattr, all

or alternatively use restorecon after the cp command finishes.

Note -a has "all":

       -a, --archive
              same as -dR --preserve=all

Comment 15 errata-xmlrpc 2020-03-31 19:47:12 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://access.redhat.com/errata/RHBA-2020:1067


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