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 2029873 - SELinux prevents the rhsm-service process from working with /memfd:libffi
Summary: SELinux prevents the rhsm-service process from working with /memfd:libffi
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.6
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 8.6
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
: 1917445 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-07 14:09 UTC by Marius Vollmer
Modified: 2022-05-10 16:24 UTC (History)
5 users (show)

Fixed In Version: selinux-policy-3.14.3-89.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 15:15:45 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-104991 0 None None None 2021-12-07 14:10:19 UTC
Red Hat Product Errata RHBA-2022:1995 0 None None None 2022-05-10 15:16:08 UTC

Description Marius Vollmer 2021-12-07 14:09:56 UTC
Description of problem:

avc:  denied  { write } for  pid=2447 comm="rhsm-service" name="memfd:libffi" dev="tmpfs" ino=41282 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=0

Version-Release number of selected component (if applicable):

subscription-manager 1.28.24-1.el8
selinux-policy-targeted-3.14.3-83.el8

How reproducible:
Always

Steps to Reproduce:
1. systemctl start rhsm.service

Actual results:
[  457.672115] audit: type=1400 audit(1638886060.853:4): avc:  denied  { write } for  pid=1778 comm="rhsm-service" name="memfd:libffi" dev="tmpfs" ino=40162 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=0
[  457.691018] audit: type=1400 audit(1638886060.871:5): avc:  denied  { write } for  pid=1778 comm="rhsm-service" name="memfd:libffi" dev="tmpfs" ino=40162 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=0

Expected results:
No audit messages for rhsm-service

Comment 1 Martin Pitt 2021-12-07 14:31:22 UTC
Adding regression. This started to happen about a week ago only. Earlier RHEL 8.6 nightlies (and also earlier 8.y) were fine.

Comment 2 Milos Malik 2021-12-07 15:21:46 UTC
# service rhsm status
Redirecting to /bin/systemctl status rhsm.service
● rhsm.service - RHSM dbus service
   Loaded: loaded (/usr/lib/systemd/system/rhsm.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2021-12-07 10:19:31 EST; 36s ago
 Main PID: 21157 (rhsm-service)
    Tasks: 2 (limit: 11356)
   Memory: 32.7M
   CGroup: /system.slice/rhsm.service
           └─21157 /usr/libexec/platform-python /usr/libexec/rhsm-service

Dec 07 10:19:30 removed systemd[1]: Starting RHSM dbus service...
Dec 07 10:19:31 removed systemd[1]: Started RHSM dbus service.
Dec 07 10:19:31 removed rhsm-service[21157]: could not allocate closure
Dec 07 10:19:31 removed rhsm-service[21157]: could not allocate closure
#

----
type=PROCTITLE msg=audit(12/07/2021 10:19:31.355:338) : proctitle=/usr/libexec/platform-python /usr/libexec/rhsm-service 
type=SYSCALL msg=audit(12/07/2021 10:19:31.355:338) : arch=x86_64 syscall=ftruncate success=no exit=EACCES(Permission denied) a0=0x9 a1=0x1000 a2=0x7f04ece62ba0 a3=0x5581e14388c0 items=0 ppid=1 pid=21157 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=rhsm-service exe=/usr/libexec/platform-python3.6 subj=system_u:system_r:rhsmcertd_t:s0 key=(null) 
type=AVC msg=audit(12/07/2021 10:19:31.355:338) : avc:  denied  { write } for  pid=21157 comm=rhsm-service name=memfd:libffi dev="tmpfs" ino=60966 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=0 
----
type=PROCTITLE msg=audit(12/07/2021 10:19:31.358:339) : proctitle=/usr/libexec/platform-python /usr/libexec/rhsm-service 
type=SYSCALL msg=audit(12/07/2021 10:19:31.358:339) : arch=x86_64 syscall=ftruncate success=no exit=EACCES(Permission denied) a0=0x9 a1=0x1000 a2=0x0 a3=0x0 items=0 ppid=1 pid=21157 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=rhsm-service exe=/usr/libexec/platform-python3.6 subj=system_u:system_r:rhsmcertd_t:s0 key=(null) 
type=AVC msg=audit(12/07/2021 10:19:31.358:339) : avc:  denied  { write } for  pid=21157 comm=rhsm-service name=memfd:libffi dev="tmpfs" ino=60966 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=0 
----

Comment 3 Milos Malik 2021-12-07 15:25:24 UTC
Following SELinux denials appear in permissive mode:
----
type=PROCTITLE msg=audit(12/07/2021 10:22:45.186:344) : proctitle=/usr/libexec/platform-python /usr/libexec/rhsm-service 
type=SYSCALL msg=audit(12/07/2021 10:22:45.186:344) : arch=x86_64 syscall=ftruncate success=yes exit=0 a0=0x9 a1=0x1000 a2=0x7fc5885c6ba0 a3=0x555e101338c0 items=0 ppid=1 pid=21223 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=rhsm-service exe=/usr/libexec/platform-python3.6 subj=system_u:system_r:rhsmcertd_t:s0 key=(null) 
type=AVC msg=audit(12/07/2021 10:22:45.186:344) : avc:  denied  { write } for  pid=21223 comm=rhsm-service name=memfd:libffi dev="tmpfs" ino=61424 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1 
----
type=PROCTITLE msg=audit(12/07/2021 10:22:45.186:345) : proctitle=/usr/libexec/platform-python /usr/libexec/rhsm-service 
type=MMAP msg=audit(12/07/2021 10:22:45.186:345) : fd=9 flags=MAP_SHARED 
type=SYSCALL msg=audit(12/07/2021 10:22:45.186:345) : arch=x86_64 syscall=mmap success=yes exit=140486531080192 a0=0x0 a1=0x1000 a2=PROT_READ|PROT_EXEC a3=MAP_SHARED items=0 ppid=1 pid=21223 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=rhsm-service exe=/usr/libexec/platform-python3.6 subj=system_u:system_r:rhsmcertd_t:s0 key=(null) 
type=AVC msg=audit(12/07/2021 10:22:45.186:345) : avc:  denied  { read execute } for  pid=21223 comm=rhsm-service path=/memfd:libffi (deleted) dev="tmpfs" ino=61424 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1 
type=AVC msg=audit(12/07/2021 10:22:45.186:345) : avc:  denied  { map } for  pid=21223 comm=rhsm-service path=/memfd:libffi (deleted) dev="tmpfs" ino=61424 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1 
----

Comment 9 Zdenek Pytela 2022-01-14 16:51:48 UTC
I've submitted a Fedora PR to address the issue:
https://github.com/fedora-selinux/selinux-policy/pull/1003

Comment 11 Zdenek Pytela 2022-01-17 16:20:58 UTC
To backport:
commit f3fcabd0de8510305767481f6dd623f5422dc26d (HEAD -> rawhide, upstream/rawhide)
Author: Zdenek Pytela <zpytela>
Date:   Fri Jan 14 17:50:08 2022 +0100

    Allow rhsm-service read/write its private memfd: objects

Comment 19 Zdenek Pytela 2022-01-21 13:10:17 UTC
*** Bug 1917445 has been marked as a duplicate of this bug. ***

Comment 20 Zdenek Pytela 2022-01-21 17:43:13 UTC
I've submitted a Fedora PR to address the remaining issues:
https://github.com/fedora-selinux/selinux-policy/pull/1019

Comment 29 errata-xmlrpc 2022-05-10 15:15:45 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 (selinux-policy bug fix and enhancement update), 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-2022:1995


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