Bug 1275478 - 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:
  Show dependency treegraph
Reported: 2015-10-26 23:10 EDT by Ömer Fadıl Usta
Modified: 2015-11-09 02:39 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-11-09 02:39:34 EST
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 Ömer Fadıl Usta 2015-10-26 23:10:14 EDT
Description of problem:
I'm not sure if it started to give this error before or after i enabled kdbus
SELinux is preventing systemd-hostnam from read, write access on the file bus.

*****  Plugin catchall (100. 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:kdbusfs_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-155.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 4.3.0-0.rc6.git2.1.fc24.x86_64 #1
                              SMP Thu Oct 22 16:10:20 UTC 2015 x86_64 x86_64
Alert Count                   4
First Seen                    2015-10-27 05:59:15 EEST
Last Seen                     2015-10-27 06:02:25 EEST
Local ID                      1440b5fd-66fd-4d49-8c12-8df45b3848b1

Raw Audit Messages
type=AVC msg=audit(1445914945.90:584): avc:  denied  { read write } for  pid=2131 comm="systemd-hostnam" name="bus" dev="kdbusfs" ino=4 scontext=system_u:system_r:systemd_hostnamed_t:s0 tcontext=system_u:object_r:kdbusfs_t:s0 tclass=file permissive=1

Hash: systemd-hostnam,systemd_hostnamed_t,kdbusfs_t,file,read,write

Version-Release number of selected component:

Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.3.0-0.rc6.git2.1.fc24.x86_64
type:           libreport
Comment 1 Daniel Walsh 2015-10-27 11:24:44 EDT
Paul is this something we should add, or should we wait for kdbus SELInux kernel changes?
Comment 2 Paul Moore 2015-10-27 11:47:59 EDT
The SELinux/kdbus work is still ongoing, and I'm not sure when it will land; honestly, I'm not sure when the kdbus bits will land upstream, I'm surprised Fedora has merged it for the Rawhide kernels.

I would suggest just hacking away and adding whatever policy is needed for kdbus at the moment to keep the users happy, it will likely all change once we have proper SELinux access control for kdbus.
Comment 3 Daniel Walsh 2015-10-27 16:53:34 EDT
Maybe we add this to         dbus_system_bus_client() for now and then remove it when kdbus has proper support.
Comment 4 Miroslav Grepl 2015-11-09 02:39:34 EST
Closing as WONTFIX for now because of dropped kdbus driver from Rawhide kernels.

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