Bug 2077750 - SELinux is preventing colord from 'map' accesses on the file /var/lib/flatpak/exports/share/mime/mime.cache.
Summary: SELinux is preventing colord from 'map' accesses on the file /var/lib/flatpak...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 36
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:7c9ca15972d75381042db77ad8a...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-22 06:23 UTC by Kamil Páral
Modified: 2022-05-02 19:43 UTC (History)
8 users (show)

Fixed In Version: selinux-policy-36.8-1.fc36
Clone Of:
Environment:
Last Closed: 2022-05-02 19:43:28 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1160 0 None open Allow colord map /var/lib directories 2022-04-22 12:13:33 UTC

Description Kamil Páral 2022-04-22 06:23:59 UTC
Description of problem:
Just logged in.
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-36.7-1.fc36.noarch
Local Policy RPM              selinux-policy-targeted-36.7-1.fc36.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.17.4-300.fc36.x86_64 #1 SMP
                              PREEMPT Wed Apr 20 14:39:58 UTC 2022 x86_64 x86_64
Alert Count                   1
First Seen                    2022-04-22 08:22:40 CEST
Last Seen                     2022-04-22 08:22:40 CEST
Local ID                      235cf119-de85-4db4-aedc-1955ddc4af04

Raw Audit Messages
type=AVC msg=audit(1650608560.170:246): avc:  denied  { map } for  pid=1268 comm="colord" path="/var/lib/flatpak/exports/share/mime/mime.cache" dev="dm-0" ino=2279754 scontext=system_u:system_r:colord_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=file permissive=0


Hash: colord,colord_t,var_lib_t,file,map

Version-Release number of selected component:
selinux-policy-targeted-36.7-1.fc36.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.17.1
hashmarkername: setroubleshoot
kernel:         5.17.4-300.fc36.x86_64
type:           libreport

Potential duplicate: bug 1917176

Comment 1 Fedora Update System 2022-04-27 08:00:53 UTC
FEDORA-2022-47789bbc9d has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-47789bbc9d

Comment 2 Fedora Update System 2022-04-28 05:11:14 UTC
FEDORA-2022-47789bbc9d has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-47789bbc9d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-47789bbc9d

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

Comment 3 Daniel 2022-04-28 14:34:37 UTC
Similar problem has been detected:

Occurs on login on a Fedroa 36 Beta system after installing any Flatpak apps via GNOME Software.

hashmarkername: setroubleshoot
kernel:         5.17.3-302.fc36.x86_64
package:        selinux-policy-targeted-36.7-1.fc36.noarch
reason:         SELinux is preventing colord from 'map' accesses on the file /var/lib/flatpak/exports/share/mime/mime.cache.
type:           libreport

Comment 4 Fedora Update System 2022-05-02 19:43:28 UTC
FEDORA-2022-47789bbc9d has been pushed to the Fedora 36 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.