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 1806894 - AVC for nm-cloud-setup.service
Summary: AVC for nm-cloud-setup.service
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.2
Hardware: Unspecified
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: 1642461 1823315
TreeView+ depends on / blocked
 
Reported: 2020-02-25 09:47 UTC by Vladimir Benes
Modified: 2021-09-03 15:17 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 16:41:41 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-38627 0 None None None 2021-09-03 15:17:50 UTC
Red Hat Product Errata RHBA-2020:1773 0 None None None 2020-04-28 16:42:05 UTC

Description Vladimir Benes 2020-02-25 09:47:05 UTC
Description of problem:
time->Tue Feb 25 04:37:13 2020
type=PROCTITLE msg=audit(1582623433.910:5879): proctitle=73797374656D63746C002D710069732D656E61626C6564006E6D2D636C6F75642D73657475702E73657276696365
type=SYSCALL msg=audit(1582623433.910:5879): arch=c000003e syscall=6 success=no exit=-13 a0=5567f7451130 a1=7fffeff00110 a2=7fffeff00110 a3=0 items=0 ppid=32330 pid=32331 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="systemctl" exe="/usr/bin/systemctl" subj=system_u:system_r:NetworkManager_t:s0 key=(null)
type=AVC msg=audit(1582623433.910:5879): avc:  denied  { getattr } for  pid=32331 comm="systemctl" path="/usr/lib/systemd/system/nm-cloud-setup.service" dev="dm-0" ino=34150428 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:systemd_unit_file_t:s0 tclass=file permissive=0

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

How reproducible:
always

Steps to Reproduce:
1. NM test suite

Actual results:
flood of AVCs

Expected results:
no AVCs

Additional info:

Comment 1 Milos Malik 2020-02-25 10:21:19 UTC
Where can I find the NM test suite?

I would like to see why systemctl is running under NetworkManager_t context.

Comment 2 Milos Malik 2020-02-25 14:14:03 UTC
Caught in enforcing mode:
----
type=PROCTITLE msg=audit(02/25/2020 09:12:34.608:661) : proctitle=systemctl -q is-enabled nm-cloud-setup.service 
type=PATH msg=audit(02/25/2020 09:12:34.608:661) : item=0 name=/usr/lib/systemd/system/nm-cloud-setup.service inode=34294278 dev=fd:00 mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:systemd_unit_file_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 
type=CWD msg=audit(02/25/2020 09:12:34.608:661) : cwd=/ 
type=SYSCALL msg=audit(02/25/2020 09:12:34.608:661) : arch=x86_64 syscall=lstat success=no exit=EACCES(Permission denied) a0=0x55f599d0b130 a1=0x7ffd2d4ca470 a2=0x7ffd2d4ca470 a3=0x0 items=1 ppid=29372 pid=29373 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=systemctl exe=/usr/bin/systemctl subj=system_u:system_r:NetworkManager_t:s0 key=(null) 
type=AVC msg=audit(02/25/2020 09:12:34.608:661) : avc:  denied  { getattr } for  pid=29373 comm=systemctl path=/usr/lib/systemd/system/nm-cloud-setup.service dev="dm-0" ino=34294278 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:systemd_unit_file_t:s0 tclass=file permissive=0 
----

Caught in permissive mode:
----
type=PROCTITLE msg=audit(02/25/2020 09:13:27.154:670) : proctitle=systemctl -q is-enabled nm-cloud-setup.service 
type=PATH msg=audit(02/25/2020 09:13:27.154:670) : item=0 name=/usr/lib/systemd/system/nm-cloud-setup.service inode=34294278 dev=fd:00 mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:systemd_unit_file_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 
type=CWD msg=audit(02/25/2020 09:13:27.154:670) : cwd=/ 
type=SYSCALL msg=audit(02/25/2020 09:13:27.154:670) : arch=x86_64 syscall=lstat success=yes exit=0 a0=0x558601234130 a1=0x7ffdbd397c50 a2=0x7ffdbd397c50 a3=0x0 items=1 ppid=29560 pid=29561 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=systemctl exe=/usr/bin/systemctl subj=system_u:system_r:NetworkManager_t:s0 key=(null) 
type=AVC msg=audit(02/25/2020 09:13:27.154:670) : avc:  denied  { getattr } for  pid=29561 comm=systemctl path=/usr/lib/systemd/system/nm-cloud-setup.service dev="dm-0" ino=34294278 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:systemd_unit_file_t:s0 tclass=file permissive=1 
----

Comment 4 Thomas Haller 2020-02-26 09:54:38 UTC
I think it's done by /usr/lib/NetworkManager/dispatcher.d/90-nm-cloud-setup.sh (which does [1]).

Note that /usr/lib/NetworkManager/dispatcher.d/90-nm-cloud-setup.sh is a symlink to "no-wait.d/90-nm-cloud-setup.sh".

These scripts in dispatcher.d are executed by NetworkManager-dispatcher service. They probably should not be labelled as NetworkManager_t.

See related issues bug 1781806 and bug 1777506.

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/9add51ef16356da81a0fd5a8f3f0ddebeb093636/clients/cloud-setup/90-nm-cloud-setup.sh

Comment 5 Thomas Haller 2020-03-04 07:47:53 UTC
Hi Milos,

can this be fixed in time for rhel-8.2?

The SELinux denial in this case seems rather sever as it spams the logs and prevents the package from working. Arguably, nm-cloud-setup is still somewhat experimental and not installed by default. However, I would appreciate if we could solve the trivial(??) issues like this.

Comment 6 Thomas Haller 2020-03-04 07:49:38 UTC
> Hi Milos,

Ups, I meant Zdenek. Sorry.

Comment 7 Zdenek Pytela 2020-03-04 08:10:35 UTC
Thomas,

Given the current RHEL 8.2 state, exception flag is required to move forward.

Comment 10 Zdenek Pytela 2020-03-04 15:55:33 UTC
Granting devel_ack. It is considered as important based on the justification.

Comment 13 Zdenek Pytela 2020-03-06 15:24:50 UTC
I've submitted a Fedora PR to address the issue:

https://github.com/fedora-selinux/selinux-policy-contrib/pull/213

Comment 42 errata-xmlrpc 2020-04-28 16:41:41 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:1773


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