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 1917445 - allow rhsmcertd_t tmpfs_t:file execute map
Summary: allow rhsmcertd_t tmpfs_t:file execute map
Keywords:
Status: CLOSED DUPLICATE of bug 2029873
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.2
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-18 13:56 UTC by Alois Mahdal
Modified: 2023-09-15 00:58 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-01-21 13:10:17 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)

Description Alois Mahdal 2021-01-18 13:56:21 UTC
Description of problem
======================

When unregistering from CDN after upgrading RHEL-7 to RHEL-8, we see these AVCs:

    SELinux status:                 enabled
    SELinuxfs mount:                /sys/fs/selinux
    SELinux root directory:         /etc/selinux
    Loaded policy name:             targeted
    Current mode:                   permissive
    Mode from config file:          permissive
    Policy MLS status:              enabled
    Policy deny_unknown status:     allowed
    Memory protection checking:     actual (secure)
    Max kernel policy version:      31
    selinux-policy-3.14.3-41.el8_2.8.noarch
    ----
    time->Thu Jan 14 11:38:43 2021
    node=kvm-01-guest11.lab.eng.rdu2.redhat.com type=PROCTITLE msg=audit(1610642323.727:320): proctitle=2F7573722F6C6962657865632F706C6174666F726D2D707974686F6E002F7573722F6C6962657865632F7268736D64
    node=kvm-01-guest11.lab.eng.rdu2.redhat.com type=MMAP msg=audit(1610642323.727:320): fd=8 flags=0x1
    node=kvm-01-guest11.lab.eng.rdu2.redhat.com type=SYSCALL msg=audit(1610642323.727:320): arch=c000003e syscall=9 success=no exit=-1 a0=0 a1=1000 a2=5 a3=1 items=0 ppid=1 pid=20562 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="rhsmd" exe="/usr/libexec/platform-python3.6" subj=system_u:system_r:rhsmcertd_t:s0-s0:c0.c1023 key=(null)
    node=kvm-01-guest11.lab.eng.rdu2.redhat.com type=AVC msg=audit(1610642323.727:320): avc:  denied  { execute } for  pid=20562 comm="rhsmd" path=2F6465762F73686D2F23313038313631202864656C6574656429 dev="tmpfs" ino=108161 scontext=system_u:system_r:rhsmcertd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1
    node=kvm-01-guest11.lab.eng.rdu2.redhat.com type=AVC msg=audit(1610642323.727:320): avc:  denied  { map } for  pid=20562 comm="rhsmd" path=2F6465762F73686D2F23313038313631202864656C6574656429 dev="tmpfs" ino=108161 scontext=system_u:system_r:rhsmcertd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1

audit2allow says (decoded on fedora 33):

    #============= rhsmcertd_t ==============
    allow rhsmcertd_t tmpfs_t:file execute;

    #!!!! This avc can be allowed using the boolean 'domain_can_mmap_files'
    allow rhsmcertd_t tmpfs_t:file map;


Version-Release number of selected component
============================================

selinux-policy-3.14.3-41.el8_2.8.noarch
subscription-manager-1.26.20-1.el8_2.x86_64


How reproducible
================

Seen once after hardening using OpenSCAP and OSPP profile.


Steps to Reproduce
==================

  1. Install RHEL-7
  2. Use RHSM to register to CDN
  3. Upgrade to RHEL-8
  4. Harden system using OpenSCAP and OSPP profile
  5. subscription-manager unregister
  6. Check AVC's

Alternatively, run extended MORF test

    @hardening-ospp

under murpy-ci

    https://liver3.brq.redhat.com/jenkins/view/OAMG/job/oamg-dispatch-upgmeta/build?delay=0sec

using specially crafted jats-morft branch with removed oamg4307 hack (talk to OAMG-QE for details) in the BSPEC field.


Actual results
==============

AVCs


Expected results
================

no AVCs


Additional info
===============

This seems to be specific to this hardening test; so far we've ran it with PROFILE=ospp:

    http://pkgs.devel.redhat.com/cgit/tests/scap-security-guide/tree/Upgrade/basic


This issue is also tracked as:

    https://issues.redhat.com/browse/OAMG-4307

Comment 1 Zdenek Pytela 2021-01-18 14:07:05 UTC
Decoding the strings:

proctitle: /usr/libexec/platform-python/usr/libexec/rhsmd
filename: /dev/shm/#108161 (deleted)

Comment 2 Zdenek Pytela 2021-10-06 21:01:31 UTC
Alois,

Do you happen to know why rhsmd wants to execute a file from /dev/shm?

Comment 3 Alois Mahdal 2021-10-13 11:15:59 UTC
No idea...

maybe @

Comment 4 Alois Mahdal 2021-10-13 11:17:59 UTC
I mean:

No idea...

maybe @jsefler will know.

(Bugzilla won't let me type properly... :( )

Comment 5 Zdenek Pytela 2022-01-13 15:06:56 UTC
@jsefler

according to the audit logs, it looks rhsmd wants to execute a file from /dev/shm: is this correct?

Comment 6 Milos Malik 2022-01-21 08:54:51 UTC
Based on the SELinux denials, I believe this bug is a duplicate of BZ#2029873.

Comment 7 Zdenek Pytela 2022-01-21 13:10:17 UTC
(In reply to Milos Malik from comment #6)
> Based on the SELinux denials, I believe this bug is a duplicate of
> BZ#2029873.

This bz is about /dev/shm/#108161 (deleted)
while the other is memfd:libffi
but from SELinux PoV it is the same problem and will have the same solution.
For the purpose of reproducing it still would be good to know why it is needed and what triggers this usage.

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

Comment 8 Red Hat Bugzilla 2023-09-15 00:58:31 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


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