Bug 1249317 - SELinux is preventing systemd-hostnam from read, write access on the file bus.
SELinux is preventing systemd-hostnam from read, write access on the file bus.
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:
Blocks: 1254238
  Show dependency treegraph
Reported: 2015-08-01 11:07 EDT by Igor Gnatenko
Modified: 2016-07-07 05:31 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-07-07 05:31:56 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:03 EDT
Description of problem:
SELinux is preventing systemd-hostnam from read, write access on the file bus.

*****  Plugin catchall_labels (83.8 confidence) suggests   *******************

If you want to allow systemd-hostnam to have read write access on the bus file
Then you need to change the label on bus
# semanage fcontext -a -t FILE_TYPE 'bus'
where FILE_TYPE is one of the following: afs_cache_t, hostname_etc_t, initrc_tmp_t, puppet_tmp_t, user_cron_spool_t. 
Then execute: 
restorecon -v 'bus'

*****  Plugin catchall (17.1 confidence) suggests   **************************

If you believe that systemd-hostnam should be allowed read write 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                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                      07c1d7d8-3165-41f8-97a8-2b4d02ee0319

Raw Audit Messages
type=AVC msg=audit(1438436634.717:3169811): avc:  denied  { read write } for  pid=30548 comm="systemd-hostnam" name="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,read,write

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 Jan Kurik 2016-02-24 08:30:42 EST
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
Comment 2 Igor Gnatenko 2016-07-07 05:31:56 EDT
kdbus issue

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