Bug 2317484 - SELinux is preventing systemd-machine from 'kill' accesses on the cap_userns labeled systemd_machined_t.
Summary: SELinux is preventing systemd-machine from 'kill' accesses on the cap_userns ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 40
Hardware: x86_64
OS: Unspecified
medium
unspecified
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:f43227e55f6d333a744f056661f...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-10-09 05:44 UTC by MstrPi
Modified: 2024-11-05 04:42 UTC (History)
8 users (show)

Fixed In Version: selinux-policy-40.29-2.fc40
Clone Of:
Environment:
Last Closed: 2024-11-05 04:42:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: description (2.00 KB, text/plain)
2024-10-09 05:45 UTC, MstrPi
no flags Details
File: os_info (734 bytes, text/plain)
2024-10-09 05:45 UTC, MstrPi
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 2381 0 None open Allow systemd-machined the kill user-namespace capability 2024-10-10 08:01:42 UTC

Description MstrPi 2024-10-09 05:44:58 UTC
Description of problem:
i attempted to stop a container with "machinectl stop container_name", and was denied. i would think systemd-machine would have proper permissions to interact with something labeled systemd_machine_t.
SELinux is preventing systemd-machine from 'kill' accesses on the cap_userns labeled systemd_machined_t.

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

If you believe that systemd-machine should be allowed kill access on cap_userns labeled systemd_machined_t 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 'systemd-machine' --raw | audit2allow -M my-systemdmachine
# semodule -X 300 -i my-systemdmachine.pp

Additional Information:
Source Context                system_u:system_r:systemd_machined_t:s0
Target Context                system_u:system_r:systemd_machined_t:s0
Target Objects                Unknown [ cap_userns ]
Source                        systemd-machine
Source Path                   systemd-machine
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-40.28-1.fc40.noarch
Local Policy RPM              selinux-policy-targeted-40.28-1.fc40.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.10.12-200.fc40.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Mon Sep 30 21:38:25 UTC 2024
                              x86_64
Alert Count                   1
First Seen                    2024-10-09 01:36:43 EDT
Last Seen                     2024-10-09 01:36:43 EDT
Local ID                      d1e13b2d-7347-4617-a22a-3d91bee413ac

Raw Audit Messages
type=AVC msg=audit(1728452203.924:854): avc:  denied  { kill } for  pid=920 comm="systemd-machine" capability=5  scontext=system_u:system_r:systemd_machined_t:s0 tcontext=system_u:system_r:systemd_machined_t:s0 tclass=cap_userns permissive=0


Hash: systemd-machine,systemd_machined_t,systemd_machined_t,cap_userns,kill

Version-Release number of selected component:
selinux-policy-targeted-40.28-1.fc40.noarch

Additional info:
reporter:       libreport-2.17.15
reason:         SELinux is preventing systemd-machine from 'kill' accesses on the cap_userns labeled systemd_machined_t.
package:        selinux-policy-targeted-40.28-1.fc40.noarch
component:      selinux-policy
hashmarkername: setroubleshoot
type:           libreport
kernel:         6.10.12-200.fc40.x86_64
comment:        i attempted to stop a container with "machinectl stop container_name", and was denied. i would think systemd-machine would have proper permissions to interact with something labeled systemd_machine_t.
component:      selinux-policy

Comment 1 MstrPi 2024-10-09 05:45:01 UTC
Created attachment 2051115 [details]
File: description

Comment 2 MstrPi 2024-10-09 05:45:03 UTC
Created attachment 2051116 [details]
File: os_info

Comment 3 Fedora Update System 2024-10-26 12:02:19 UTC
FEDORA-2024-aa24e6024f (selinux-policy-40.29-1.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-aa24e6024f

Comment 4 Fedora Update System 2024-10-28 03:49:59 UTC
FEDORA-2024-a9588c99c1 has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-a9588c99c1`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-a9588c99c1

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2024-11-05 04:42:54 UTC
FEDORA-2024-a9588c99c1 (selinux-policy-40.29-2.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


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