Bug 1391363 - SELinux is preventing chronyd from 'open' accesses on the file /var/lib/chrony/drift.
Summary: SELinux is preventing chronyd from 'open' accesses on the file /var/lib/chron...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 24
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:65e962ad15b66ece6e8df21ed59...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-03 07:51 UTC by krp
Modified: 2017-08-08 19:07 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 19:07:21 UTC
Type: ---


Attachments (Terms of Use)

Description krp 2016-11-03 07:51:42 UTC
Description of problem:
I just turn off SELinux. Reboot and then enable SELinux. Reboot and have this conflict
SELinux is preventing chronyd from 'open' accesses on the file /var/lib/chrony/drift.

*****  Plugin restorecon (94.8 confidence) suggests   ************************

If необходимо исправить метку.
Стандартная метка для /var/lib/chrony/drift: chronyd_var_lib_t.
Then можно выполнить restorecon.
Do
# /sbin/restorecon -v /var/lib/chrony/drift

*****  Plugin catchall_labels (5.21 confidence) suggests   *******************

If you want to allow chronyd to have open access on the drift file
Then необходимо изменить метку на /var/lib/chrony/drift
Do
# semanage fcontext -a -t FILE_TYPE '/var/lib/chrony/drift'
where FILE_TYPE is one of the following: abrt_helper_exec_t, abrt_var_run_t, bin_t, boot_t, cert_t, cgroup_t, chronyd_exec_t, chronyd_keys_t, chronyd_tmpfs_t, chronyd_var_lib_t, chronyd_var_log_t, chronyd_var_run_t, cluster_conf_t, cluster_var_lib_t, cluster_var_run_t, courier_exec_t, cpu_online_t, dbusd_etc_t, dhcpc_state_t, etc_runtime_t, etc_t, exim_exec_t, fail2ban_var_lib_t, file_context_t, fonts_cache_t, fonts_t, gpsd_tmpfs_t, hostname_etc_t, krb5_conf_t, ld_so_cache_t, ld_so_t, lib_t, locale_t, machineid_t, man_cache_t, man_t, mandb_cache_t, net_conf_t, passwd_file_t, postfix_postdrop_t, prelink_exec_t, proc_t, rkhunter_var_lib_t, rpm_script_tmp_t, samba_etc_t, samba_var_t, sendmail_exec_t, shell_exec_t, sosreport_tmp_t, src_t, sssd_public_t, sssd_var_lib_t, sysfs_t, system_conf_t, system_db_t, system_dbusd_var_lib_t, systemd_logind_var_run_t, systemd_passwd_agent_exec_t, systemd_passwd_var_run_t, systemd_systemctl_exec_t, textrel_shlib_t, timemaster_tmpfs_t, timemaster_var_run_t, usr_t.
Then execute:
restorecon -v '/var/lib/chrony/drift'


*****  Plugin catchall (1.44 confidence) suggests   **************************

If вы считаете, что chronyd следует разрешить доступ open к drift file по умолчанию.
Then рекомендуется создать отчет об ошибке.
Чтобы разрешить доступ, можно создать локальный модуль политики.
Do
allow this access for now by executing:
# ausearch -c 'chronyd' --raw | audit2allow -M my-chronyd
# semodule -X 300 -i my-chronyd.pp

Additional Information:
Source Context                system_u:system_r:chronyd_t:s0
Target Context                system_u:object_r:unlabeled_t:s0
Target Objects                /var/lib/chrony/drift [ file ]
Source                        chronyd
Source Path                   chronyd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           chrony-2.4-1.fc24.x86_64
Policy RPM                    selinux-policy-3.13.1-191.19.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 4.7.9-200.fc24.x86_64 #1 SMP Thu
                              Oct 20 14:26:16 UTC 2016 x86_64 x86_64
Alert Count                   1
First Seen                    2016-11-01 14:41:25 EET
Last Seen                     2016-11-01 14:41:25 EET
Local ID                      51325e44-980c-41d7-9abf-997e794374f8

Raw Audit Messages
type=AVC msg=audit(1478004085.218:98): avc:  denied  { open } for  pid=1348 comm="chronyd" path="/var/lib/chrony/drift" dev="sda5" ino=802470 scontext=system_u:system_r:chronyd_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file permissive=1


Hash: chronyd,chronyd_t,unlabeled_t,file,open

Version-Release number of selected component:
selinux-policy-3.13.1-191.19.fc24.noarch

Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.7.9-200.fc24.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2016-11-07 19:50:51 UTC
Issue is caused by turning SELinux off. Please run:
# restorecon -Rv / 

To fix labels on your system.

Comment 2 krp 2016-11-08 09:32:05 UTC
I did
# restorecon -Rv /

and get many 865 warnings like this

restorecon:  Warning no default label for /tmp/skype-3154
restorecon:  Warning no default label for /tmp/skype-3154/DbTemp.
restorecon:  Warning no default label for /tmp/skype-3154/DbTemp./temp-IuLAWAKeb725V1Jlf6nqOH0F
restorecon:  Warning no default label for /tmp/skype-3154/DbTemp./temp-SdT5mKmrOOj3KiPGkQFaZfyZ
restorecon:  Warning no default label for /tmp/qtsingleapp-homekr-2037-3e8
restorecon:  Warning no default label for /tmp/qtsingleapp-homekr-2037-3e8-lockfile
restorecon:  Warning no default label for /tmp/qtsingleapp-HipCha-9b70-3e8
restorecon:  Warning no default label for /tmp/qtsingleapp-HipCha-9b70-3e8-lockfile
restorecon:  Warning no default label for /tmp/Slack Crashes
restorecon:  Warning no default label for /tmp/.org.chromium.Chromium.brqZaC
restorecon:  Warning no default label for /tmp/.org.chromium.Chromium.brqZaC/SS
restorecon:  Warning no default label for /tmp/.org.chromium.Chromium.brqZaC/SingletonCookie
restorecon:  Warning no default label for /tmp/tracker-extract-files.1000
restorecon:  Warning no default label for /tmp/orbit-krp
restorecon:  Warning no default label for /tmp/.esd-1000
restorecon:  Warning no default label for /tmp/.esd-1000/socket
restorecon:  Warning no default label for /tmp/.X1024-lock

Comment 3 Daniel Walsh 2016-11-08 15:05:34 UTC
Those are just telling you that SELinux does not have default labels for content in /tmp directories, so it will do nothing.

Comment 4 Fedora End Of Life 2017-07-25 23:45:02 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2017-08-08 19:07:21 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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