Bug 2230784

Summary: SELinux is preventing systemd-user-ru from 'write' accesses on the directory gnome-shell.
Product: [Fedora] Fedora Reporter: tongnguyenminhkhang21012020
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: dwalsh, lvrabec, mmalik, nknazeko, omosnacek, pkoncity, tongnguyenminhkhang21012020, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:99eb4db06122d083d621b047ba1baa6dc70ff4b482cd7130d744a9b5d36e32dd;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-11 13:16:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: os_info
none
File: description none

Description tongnguyenminhkhang21012020 2023-08-10 05:32:42 UTC
Description of problem:
I change my GNOME Shell's theme using gdm-tweak-tools installed through dnf, for some reason libreport crashed after applyin the new theme, I logged out and logged in again to apply GDM theme
SELinux is preventing systemd-user-ru from 'write' accesses on the directory gnome-shell.

*****  Plugin catchall_labels (83.8 confidence) suggests   *******************

If you want to allow systemd-user-ru to have write access on the gnome-shell directory
Then you need to change the label on gnome-shell
Do
# semanage fcontext -a -t FILE_TYPE 'gnome-shell'
where FILE_TYPE is one of the following: abrt_var_cache_t, cgroup_t, config_home_t, container_file_t, efivarfs_t, fusefs_t, gkeyringd_tmp_t, gstreamer_home_t, init_var_lib_t, init_var_run_t, krb5_host_rcache_t, mozilla_plugin_tmp_t, mozilla_plugin_tmpfs_t, session_dbusd_tmp_t, systemd_logind_inhibit_var_run_t, systemd_logind_sessions_t, systemd_logind_var_lib_t, systemd_logind_var_run_t, systemd_passwd_var_run_t, tmp_t, tmpfs_t, udev_rules_t, user_tmp_t, var_auth_t, var_run_t.
Then execute:
restorecon -v 'gnome-shell'


*****  Plugin catchall (17.1 confidence) suggests   **************************

If you believe that systemd-user-ru should be allowed write access on the gnome-shell directory 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-user-ru' --raw | audit2allow -M my-systemduserru
# semodule -X 300 -i my-systemduserru.pp

Additional Information:
Source Context                system_u:system_r:systemd_logind_t:s0
Target Context                system_u:object_r:usr_t:s0
Target Objects                gnome-shell [ dir ]
Source                        systemd-user-ru
Source Path                   systemd-user-ru
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-38.22-1.fc38.noarch
Local Policy RPM              selinux-policy-targeted-38.22-1.fc38.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.4.7-200.fc38.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Thu Jul 27 20:01:18 UTC 2023
                              x86_64
Alert Count                   32
First Seen                    2023-08-10 12:27:11 +07
Last Seen                     2023-08-10 12:27:11 +07
Local ID                      d0c51852-b655-47a7-9224-70edcbc9be69

Raw Audit Messages
type=AVC msg=audit(1691645231.545:599): avc:  denied  { write } for  pid=42159 comm="systemd-user-ru" name="gnome-shell" dev="tmpfs" ino=4791 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:usr_t:s0 tclass=dir permissive=0


Hash: systemd-user-ru,systemd_logind_t,usr_t,dir,write

Version-Release number of selected component:
selinux-policy-targeted-38.22-1.fc38.noarch

Additional info:
reporter:       libreport-2.17.11
hashmarkername: setroubleshoot
reason:         SELinux is preventing systemd-user-ru from 'write' accesses on the directory gnome-shell.
type:           libreport
kernel:         6.4.7-200.fc38.x86_64
package:        selinux-policy-targeted-38.22-1.fc38.noarch
comment:        I change my GNOME Shell's theme using gdm-tweak-tools installed through dnf, for some reason libreport crashed after applyin the new theme, I logged out and logged in again to apply GDM theme
component:      selinux-policy
component:      selinux-policy

Comment 1 tongnguyenminhkhang21012020 2023-08-10 05:32:45 UTC
Created attachment 1982716 [details]
File: os_info

Comment 2 tongnguyenminhkhang21012020 2023-08-10 05:32:48 UTC
Created attachment 1982717 [details]
File: description

Comment 3 Zdenek Pytela 2023-08-10 11:22:32 UTC
Hi,

Where exactly the process failed, was it the rpm package installation?
I cannot find gdm-tweak-tools package in Fedora.

Comment 4 tongnguyenminhkhang21012020 2023-08-11 10:00:58 UTC
Oops, my fault, I installed GDM Tools on Flathub, sorry for any convenience.

Comment 5 Zdenek Pytela 2023-08-11 13:16:39 UTC
Closing then, you may ask the package vendor for further assistance.