Bug 1949222

Summary: SELinux is preventing colord from 'map' accesses on the file /var/lib/flatpak/exports/share/mime/mime.cache.
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwalsh, grepl.miroslav, lvrabec, mmalik, omosnace, plautrba, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:7c9ca15972d75381042db77ad8a3d71ec4a030fcccccaaeb259b31f9b231636b;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-13 18:45:57 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:

Description Mikhail 2021-04-13 18:03:52 UTC
Description of problem:
SELinux is preventing colord from 'map' accesses on the file /var/lib/flatpak/exports/share/mime/mime.cache.

*****  Plugin catchall_boolean (57.6 confidence) suggests   ******************

If you want to allow domain to can mmap files
Then you must tell SELinux about this by enabling the 'domain_can_mmap_files' boolean.

Do
setsebool -P domain_can_mmap_files 1

*****  Plugin catchall_labels (36.2 confidence) suggests   *******************

If you want to allow colord to have map access on the mime.cache file
Then you need to change the label on /var/lib/flatpak/exports/share/mime/mime.cache
Do
# semanage fcontext -a -t FILE_TYPE '/var/lib/flatpak/exports/share/mime/mime.cache'
where FILE_TYPE is one of the following: abrt_helper_exec_t, bin_t, boot_t, cert_t, colord_exec_t, data_home_t, etc_runtime_t, etc_t, file_context_t, fonts_cache_t, fonts_t, gconf_home_t, icc_data_home_t, ifconfig_exec_t, ld_so_cache_t, ld_so_t, lib_t, locale_t, nscd_var_run_t, passwd_file_t, pkcs11_modules_conf_t, policykit_auth_exec_t, prelink_exec_t, shell_exec_t, src_t, sssd_public_t, system_conf_t, system_db_t, systemd_hwdb_etc_t, textrel_shlib_t, user_home_t, user_tmp_t, usr_t, xdm_var_lib_t, xdm_var_run_t.
Then execute:
restorecon -v '/var/lib/flatpak/exports/share/mime/mime.cache'


*****  Plugin catchall (7.64 confidence) suggests   **************************

If you believe that colord should be allowed map access on the mime.cache file 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 'colord' --raw | audit2allow -M my-colord
# semodule -X 300 -i my-colord.pp

Additional Information:
Source Context                system_u:system_r:colord_t:s0
Target Context                system_u:object_r:var_lib_t:s0
Target Objects                /var/lib/flatpak/exports/share/mime/mime.cache [
                              file ]
Source                        colord
Source Path                   colord
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-34.3-1.fc35.noarch
Local Policy RPM              selinux-policy-targeted-34.3-1.fc35.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 5.12.0-0.rc7.189.fc35.x86_64 #1
                              SMP Mon Apr 12 18:53:43 UTC 2021 x86_64 x86_64
Alert Count                   1
First Seen                    2021-04-13 19:29:17 +05
Last Seen                     2021-04-13 19:29:17 +05
Local ID                      12c80562-40bb-42b3-bdf2-1b75443dc178

Raw Audit Messages
type=AVC msg=audit(1618324157.274:174): avc:  denied  { map } for  pid=1281 comm="colord" path="/var/lib/flatpak/exports/share/mime/mime.cache" dev="nvme0n1p2" ino=10239944 scontext=system_u:system_r:colord_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=file permissive=1


Hash: colord,colord_t,var_lib_t,file,map

Version-Release number of selected component:
selinux-policy-targeted-34.3-1.fc35.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.14.0
hashmarkername: setroubleshoot
kernel:         5.12.0-0.rc7.189.fc35.x86_64
type:           libreport

Potential duplicate: bug 1917176

Comment 1 Zdenek Pytela 2021-04-13 18:45:57 UTC

*** This bug has been marked as a duplicate of bug 1928548 ***