Bug 2017838
Summary: | Running systemctl status of user triggered AVC denials | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Patrik Koncity <pkoncity> | |
Component: | selinux-policy | Assignee: | Zdenek Pytela <zpytela> | |
Status: | CLOSED ERRATA | QA Contact: | Milos Malik <mmalik> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 9.0 | CC: | lvrabec, mmalik, ssekidde | |
Target Milestone: | rc | Keywords: | AutoVerified, Triaged | |
Target Release: | 9.0 | |||
Hardware: | All | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | selinux-policy-34.1.19-1.el9 | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 2046481 (view as bug list) | Environment: | ||
Last Closed: | 2022-05-17 15:49:53 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1778780, 2046481 |
Description
Patrik Koncity
2021-10-27 14:04:43 UTC
Surprisingly, there are no SELinux denials in enforcing mode and the systemctl output looks this way: $ id uid=1000(basic_user) gid=1000(basic_user) groups=1000(basic_user),10(wheel) context=user_u:user_r:user_t:s0 $ systemctl status user@1000 × user - User Manager for UID 1000 Loaded: loaded (/usr/lib/systemd/system/user@.service; static) Active: failed (Result: exit-code) since Tue 2021-11-02 03:08:29 EDT; 6min ago Docs: man:user@.service(5) Process: 3957 ExecStart=/usr/lib/systemd/systemd --user (code=exited, status=1/FAILURE) Main PID: 3957 (code=exited, status=1/FAILURE) CPU: 53ms $ After switching to permissive mode, the picture becomes clearer now: $ id uid=1000(basic_user) gid=1000(basic_user) groups=1000(basic_user),10(wheel) context=user_u:user_r:user_t:s0 $ systemctl status user@1000 × user - User Manager for UID 1000 Loaded: loaded (/usr/lib/systemd/system/user@.service; static) Active: failed (Result: exit-code) since Tue 2021-11-02 03:08:29 EDT; 3min 30s ago Docs: man:user@.service(5) Process: 3957 ExecStart=/usr/lib/systemd/systemd --user (code=exited, status=1/FAILURE) Main PID: 3957 (code=exited, status=1/FAILURE) CPU: 53ms Nov 02 03:08:29 localhost systemd[1]: Starting User Manager for UID 1000... Nov 02 03:08:29 localhost systemd[3957]: pam_unix(systemd-user:session): session opened for user basic_user(uid=1000) by (uid=0) Nov 02 03:08:29 localhost systemd[3957]: Failed to allocate manager object: Permission denied Nov 02 03:08:29 localhost systemd[1]: user: Main process exited, code=exited, status=1/FAILURE Nov 02 03:08:29 localhost systemd[1]: user: Failed with result 'exit-code'. Nov 02 03:08:29 localhost systemd[1]: Failed to start User Manager for UID 1000. $ Hi Milos, we have several way how reproduce AVC's. First, try to change the configuration file /etc/selinux/config in line SELINUX=enforcing to SELINUX=permissive then, reboot machine and you'll see AVC's in permissive mode. Machine need to be run in permissive mode for sucessfully start of systemctl. Second way, you must as root restart systemctl, but firstly you should set permissive mode via # setenforce 0 then restart # systemctl restart user@{UID of basic_user} and then when you log in like user_u and show systemctl status of user, you are able to see whole permissive output. Thanks, Patrik Commits to backport: commit 5d0c765573488ac5f1bf5f377d51173b3180883f Author: Zdenek Pytela <zpytela> Date: Wed May 5 13:38:36 2021 +0200 Allow login_userdomain read and map /var/lib/systemd files and https://github.com/fedora-selinux/selinux-policy/pull/955 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 (new packages: selinux-policy), 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:3918 |