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 1979182 - avc: denied { getattr } for comm="systemctl" name="/" on systemctl start cockpit.socket
Summary: avc: denied { getattr } for comm="systemctl" name="/" on systemctl start c...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.5
Hardware: All
OS: Linux
medium
medium
Target Milestone: beta
: 8.5
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
: 1983268 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-05 07:15 UTC by Martin Pitt
Modified: 2021-11-10 08:38 UTC (History)
5 users (show)

Fixed In Version: selinux-policy-3.14.3-76.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 19:43:34 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:4420 0 None None None 2021-11-09 19:44:02 UTC

Description Martin Pitt 2021-07-05 07:15:48 UTC
Description of problem: Most recent RHEL 8.5 nightlies [1] introduced a new SELinux rejection related to starting cockpit.socket.


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

cockpit-247-1.el8.x86_64
selinux-policy-3.14.3-71.el8.noarch
systemd-239-48.el8.x86_64

The image build log has a comprehensive version diff, but the only relevant ones seem to be:

    glibc (2.28-158.el8 -> 2.28-161.el8)
    kernel (4.18.0-314.el8 -> 4.18.0-318.el8)
    systemd (239-45.el8_4.1 -> 239-48.el8)

How reproducible: Always

Steps to Reproduce:
1. systemctl start cockpit.socket

I tried a few other units like rpcbind.socket, but curiously they don't seem to trigger the bug.

Actual results: SELinux violation:

    avc:  denied  { getattr } for  pid=2005 comm="systemctl" name="/" dev="vda3" ino=128 scontext=system_u:system_r:cockpit_ws_t:s0 tcontext=system_u:object_r:fs_t:s0 tclass=filesystem permissive=0


Expected results: No violation.


Additional info:

[1] https://github.com/cockpit-project/bots/pull/2156
[2] https://logs.cockpit-project.org/logs/image-refresh-2156-20210630-112020/log

Comment 1 Milos Malik 2021-07-13 10:55:35 UTC
Following SELinux denial appears in enforcing mode:
----
type=PROCTITLE msg=audit(07/13/2021 10:48:15.711:195) : proctitle=systemctl show --property Listen cockpit.socket 
type=SYSCALL msg=audit(07/13/2021 10:48:15.711:195) : arch=x86_64 syscall=fstatfs success=no exit=EACCES(Permission denied) a0=0x3 a1=0x7fffc8eea410 a2=0x280100 a3=0x0 items=0 ppid=1920 pid=1921 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:cockpit_ws_t:s0 key=(null) 
type=AVC msg=audit(07/13/2021 10:48:15.711:195) : avc:  denied  { getattr } for  pid=1921 comm=systemctl name=/ dev="vda2" ino=96 scontext=system_u:system_r:cockpit_ws_t:s0 tcontext=system_u:object_r:fs_t:s0 tclass=filesystem permissive=0 
----

The same SELinux denial appears in permissive mode:
----
type=PROCTITLE msg=audit(07/13/2021 12:48:49.975:894) : proctitle=systemctl show --property Listen cockpit.socket 
type=SYSCALL msg=audit(07/13/2021 12:48:49.975:894) : arch=x86_64 syscall=fstatfs success=yes exit=0 a0=0x3 a1=0x7fff5a78b180 a2=0x280100 a3=0x0 items=0 ppid=45933 pid=45934 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:cockpit_ws_t:s0 key=(null) 
type=AVC msg=audit(07/13/2021 12:48:49.975:894) : avc:  denied  { getattr } for  pid=45934 comm=systemctl name=/ dev="vda2" ino=96 scontext=system_u:system_r:cockpit_ws_t:s0 tcontext=system_u:object_r:fs_t:s0 tclass=filesystem permissive=1 
----

# find / -xdev -inum 96
/
/boot
# df | grep vda
/dev/vda2        8901632 8259664    641968  93% /
/dev/vda1         520868  261396    259472  51% /boot
#

# rpm -qa selinux-policy\* cockpit\* | sort
cockpit-248-1.el8.x86_64
cockpit-bridge-248-1.el8.x86_64
cockpit-packagekit-248-1.el8.noarch
cockpit-storaged-248-1.el8.noarch
cockpit-system-248-1.el8.noarch
cockpit-ws-248-1.el8.x86_64
selinux-policy-3.14.3-72.el8.noarch
selinux-policy-devel-3.14.3-72.el8.noarch
selinux-policy-doc-3.14.3-72.el8.noarch
selinux-policy-minimum-3.14.3-72.el8.noarch
selinux-policy-mls-3.14.3-72.el8.noarch
selinux-policy-sandbox-3.14.3-72.el8.noarch
selinux-policy-targeted-3.14.3-72.el8.noarch
#

Comment 3 Zdenek Pytela 2021-07-30 12:06:22 UTC
*** Bug 1983268 has been marked as a duplicate of this bug. ***

Comment 4 Phil Baker 2021-07-30 14:08:57 UTC
selinux-policy-3.14.3-74.el8.noarch

My output of # ausearch -m avc -m user_avc -m selinux_err -i -ts today

----
type=PROCTITLE msg=audit(07/30/2021 13:59:51.174:11) : proctitle=systemctl show --property Listen cockpit.socket 
type=SYSCALL msg=audit(07/30/2021 13:59:51.174:11) : arch=x86_64 syscall=fstatfs success=no exit=EACCES(Permission denied) a0=0x3 a1=0x7ffc9b0e1c10 a2=0x280100 a3=0x0 items=0 ppid=888 pid=889 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:cockpit_ws_t:s0 key=(null) 
type=AVC msg=audit(07/30/2021 13:59:51.174:11) : avc:  denied  { getattr } for  pid=889 comm=systemctl name=/ dev="dm-0" ino=128 scontext=system_u:system_r:cockpit_ws_t:s0 tcontext=system_u:object_r:fs_t:s0 tclass=filesystem permissive=0 
----
type=PROCTITLE msg=audit(07/30/2021 13:59:51.562:31) : proctitle=systemctl show --property Listen cockpit.socket 
type=SYSCALL msg=audit(07/30/2021 13:59:51.562:31) : arch=x86_64 syscall=fstatfs success=no exit=EACCES(Permission denied) a0=0x3 a1=0x7ffd2b79cdf0 a2=0x280100 a3=0x0 items=0 ppid=1177 pid=1180 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:cockpit_ws_t:s0 key=(null) 
type=AVC msg=audit(07/30/2021 13:59:51.562:31) : avc:  denied  { getattr } for  pid=1180 comm=systemctl name=/ dev="dm-0" ino=128 scontext=system_u:system_r:cockpit_ws_t:s0 tcontext=system_u:object_r:fs_t:s0 tclass=filesystem permissive=0

Comment 5 Zdenek Pytela 2021-07-30 16:25:34 UTC
I've submitted a Fedora PR to address the issue:
https://github.com/fedora-selinux/selinux-policy/pull/819

Comment 6 Zdenek Pytela 2021-08-10 15:08:31 UTC
Commit to backport:
commit 95b6d266399a0c0484cfba33fdf24f5d0ec1759e (HEAD -> rawhide, upstream/rawhide)
Author: Zdenek Pytela <zpytela>
Date:   Fri Jul 30 18:14:34 2021 +0200

    Allow cockpit_ws_t get attributes of fs_t filesystems

Comment 17 errata-xmlrpc 2021-11-09 19:43:34 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-2021:4420


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