Bug 1249318 - SELinux is preventing systemd-hostnam from 'open' accesses on the file /sys/fs/kdbus/0-system/bus.
Summary: SELinux is preventing systemd-hostnam from 'open' accesses on the file /sys/f...
Keywords:
Status: CLOSED DUPLICATE of bug 1249320
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: rawhide
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:b9e5e3fcb9ec6b5e056224552a2...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-01 15:07 UTC by Igor Gnatenko
Modified: 2015-08-04 13:46 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-04 13:46:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Igor Gnatenko 2015-08-01 15:07:28 UTC
Description of problem:
kdbus=1
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.
Do
# /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
Do
# 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.
Do
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:
selinux-policy-3.13.1-138.fc24.noarch

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 13:46:02 UTC

*** 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.