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 1927844 - SELinux is preventing rhsmcertd-worke from getattr access on the file /usr/sbin/kpatch
Summary: SELinux is preventing rhsmcertd-worke from getattr access on the file /usr/sb...
Keywords:
Status: CLOSED DUPLICATE of bug 1895322
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.3
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-11 16:31 UTC by Joerg K
Modified: 2022-01-05 13:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-11 16:42:55 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Joerg K 2021-02-11 16:31:04 UTC
Description of problem:
Checking journal for any selinux related error messages shows the message from the summary.

Version-Release number of selected component (if applicable):
selinux-policy-3.14.3-54.el8_3.2.noarch
selinux-policy-targeted-3.14.3-54.el8_3.2.noarch
kernel 4.18.0-240.10.1.el8_3.x86_64

How reproducible:
Everytime I check the journal on this system.

Steps to Reproduce:
1. sudo journalctl -t setroubleshoot

Actual results:
Feb 11 15:15:39 rhel8-squid.lan setroubleshoot[12674]: SELinux is preventing rhsmcertd-worke from getattr access on the file /usr/sbin/kpatch. For complete SELinux messages run: sealert -l a5301740-ee24-4a55-96e4-556b0f857615
Feb 11 15:15:39 rhel8-squid.lan setroubleshoot[12674]: SELinux is preventing rhsmcertd-worke from getattr access on the file /usr/sbin/kpatch.
                                                       
                                                       *****  Plugin catchall (100. confidence) suggests   **************************
                                                       
                                                       If you believe that rhsmcertd-worke should be allowed getattr access on the kpatch file by default.
                                                       Then you should report this as a bug.
                                                       You can generate a local policy module to allow this access.
                                                       Do
                                                       allow this access for now by executing:
                                                       # ausearch -c 'rhsmcertd-worke' --raw | audit2allow -M my-rhsmcertdworke
                                                       # semodule -X 300 -i my-rhsmcertdworke.pp
                                                       
Feb 11 15:15:39 rhel8-squid.lan setroubleshoot[12674]: AnalyzeThread.run(): Set alarm timeout to 10

Complete SELinux message:
[joerg@rhel8-squid ~]$ sudo sealert -l a5301740-ee24-4a55-96e4-556b0f857615
SELinux is preventing rhsmcertd-worke from getattr access on the file /usr/sbin/kpatch.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that rhsmcertd-worke should be allowed getattr access on the kpatch file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'rhsmcertd-worke' --raw | audit2allow -M my-rhsmcertdworke
# semodule -X 300 -i my-rhsmcertdworke.pp


Additional Information:
Source Context                system_u:system_r:rhsmcertd_t:s0
Target Context                system_u:object_r:kpatch_exec_t:s0
Target Objects                /usr/sbin/kpatch [ file ]
Source                        rhsmcertd-worke
Source Path                   rhsmcertd-worke
Port                          <Unknown>
Host                          rhel8-squid.lan
Source RPM Packages           
Target RPM Packages           kpatch-0.6.1-6.el8.noarch
SELinux Policy RPM            selinux-policy-targeted-3.14.3-54.el8_3.2.noarch
Local Policy RPM              selinux-policy-targeted-3.14.3-54.el8_3.2.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     rhel8-squid.lan
Platform                      Linux rhel8-squid.lan 4.18.0-240.10.1.el8_3.x86_64
                              #1 SMP Wed Dec 16 03:30:52 EST 2020 x86_64 x86_64
Alert Count                   908
First Seen                    2020-11-09 00:42:02 CET
Last Seen                     2021-02-11 15:15:35 CET
Local ID                      a5301740-ee24-4a55-96e4-556b0f857615

Raw Audit Messages
type=AVC msg=audit(1613052935.327:438): avc:  denied  { getattr } for  pid=12587 comm="rhsmcertd-worke" path="/usr/sbin/kpatch" dev="dm-0" ino=542911 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:kpatch_exec_t:s0 tclass=file permissive=0


Hash: rhsmcertd-worke,rhsmcertd_t,kpatch_exec_t,file,getattr

Expected results:
No selinux issues on standard system.

Additional info:
Another RHEL 8.3 box with same patch level similar issue:
Feb 11 16:52:26 podhost-r8-1.lan setroubleshoot[12160]: SELinux is preventing /usr/libexec/platform-python3.6 from getattr access on the file /usr/sbin/kpatch. For complete SELinux messages run: sealert -l c7347e5e-78da-48c0-a534-9d3e2b27dc97
Feb 11 16:52:26 podhost-r8-1.lan setroubleshoot[12160]: SELinux is preventing /usr/libexec/platform-python3.6 from getattr access on the file /usr/sbin/kpatch.
                                                        
                                                        *****  Plugin catchall (100. confidence) suggests   **************************
                                                        
                                                        If you believe that platform-python3.6 should be allowed getattr access on the kpatch file by default.
                                                        Then you should report this as a bug.
                                                        You can generate a local policy module to allow this access.
                                                        Do
                                                        allow this access for now by executing:
                                                        # ausearch -c 'rhsmcertd-worke' --raw | audit2allow -M my-rhsmcertdworke
                                                        # semodule -X 300 -i my-rhsmcertdworke.pp
                                                        
Feb 11 16:52:26 podhost-r8-1.lan setroubleshoot[12160]: AnalyzeThread.run(): Set alarm timeout to 10

I ran `sudo restorecon -nFv /usr/sbin/kpatch` on both boxes to see if the file context is off but it seems not. So I don't know why getattr is needed but these errors IMHO shouldn't appear in default configuration.

Comment 1 Zdenek Pytela 2021-02-11 16:42:55 UTC

*** This bug has been marked as a duplicate of bug 1895322 ***


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