Bug 1249318 - SELinux is preventing systemd-hostnam from 'open' accesses on the file /sys/fs/kdbus/0-system/bus.
SELinux is preventing systemd-hostnam from 'open' accesses on the file /sys/f...
Status: CLOSED DUPLICATE of bug 1249320
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-08-01 11:07 EDT by Igor Gnatenko
Modified: 2015-08-04 09:46 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-08-04 09:46:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Igor Gnatenko 2015-08-01 11:07:28 EDT
Description of problem:
SELinux is preventing systemd-hostnam from 'open' accesses on the file /sys/fs/kdbus/0-system/bus.

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

If you want to fix the label. 
/sys/fs/kdbus/0-system/bus default label should be sysfs_t.
Then you can run restorecon.
# /sbin/restorecon -v /sys/fs/kdbus/0-system/bus

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

If you want to allow systemd-hostnam to have open access on the bus file
Then you need to change the label on /sys/fs/kdbus/0-system/bus
# semanage fcontext -a -t FILE_TYPE '/sys/fs/kdbus/0-system/bus'
where FILE_TYPE is one of the following: abrt_helper_exec_t, abrt_var_run_t, bin_t, boot_t, cluster_conf_t, cluster_var_lib_t, cluster_var_run_t, cpu_online_t, dbusd_etc_t, etc_runtime_t, etc_t, fail2ban_var_lib_t, file_context_t, fonts_cache_t, fonts_t, hostname_etc_t, ld_so_cache_t, ld_so_t, lib_t, locale_t, machineid_t, man_cache_t, man_t, mandb_cache_t, prelink_exec_t, proc_t, proc_xen_t, rkhunter_var_lib_t, rpm_script_tmp_t, selinux_config_t, shell_exec_t, sosreport_tmp_t, src_t, sysfs_t, system_conf_t, system_db_t, system_dbusd_var_lib_t, systemd_home_t, systemd_hostnamed_exec_t, textrel_shlib_t, usr_t. 
Then execute: 
restorecon -v '/sys/fs/kdbus/0-system/bus'

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

If you believe that systemd-hostnam should be allowed open access on the bus file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# grep systemd-hostnam /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:systemd_hostnamed_t:s0
Target Context                system_u:object_r:unlabeled_t:s0
Target Objects                /sys/fs/kdbus/0-system/bus [ file ]
Source                        systemd-hostnam
Source Path                   systemd-hostnam
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-138.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 4.2.0-0.rc4.git4.1.fc24.x86_64 #1
                              SMP Fri Jul 31 16:32:22 UTC 2015 x86_64 x86_64
Alert Count                   4
First Seen                    2015-08-01 13:52:40 MSK
Last Seen                     2015-08-01 16:43:54 MSK
Local ID                      f3a6c334-01bd-4895-bf21-3f0613a316ac

Raw Audit Messages
type=AVC msg=audit(1438436634.717:3169812): avc:  denied  { open } for  pid=30548 comm="systemd-hostnam" path="/sys/fs/kdbus/0-system/bus" dev="kdbusfs" ino=4 scontext=system_u:system_r:systemd_hostnamed_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file permissive=1

Hash: systemd-hostnam,systemd_hostnamed_t,unlabeled_t,file,open

Version-Release number of selected component:

Additional info:
reporter:       libreport-2.6.2
hashmarkername: setroubleshoot
kernel:         4.2.0-0.rc4.git4.1.fc24.x86_64
type:           libreport
Comment 1 Daniel Walsh 2015-08-04 09:46:02 EDT

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

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