Bug 1275478

Summary: SELinux is preventing systemd-hostnam from read, write access on the file bus.
Product: [Fedora] Fedora Reporter: Ömer Fadıl Usta <omerusta>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba, pmoore
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:2423636f4f70df5910d396457896bcd704fc6e1ccf366127f7323cd46d9aa754;VARIANT_ID=workstation;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-09 07:39:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ömer Fadıl Usta 2015-10-27 03:10:14 UTC
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.
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: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:
selinux-policy-3.13.1-155.fc24.noarch

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 15:24:44 UTC
Paul is this something we should add, or should we wait for kdbus SELInux kernel changes?

Comment 2 Paul Moore 2015-10-27 15:47:59 UTC
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 20:53:34 UTC
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 07:39:34 UTC
Closing as WONTFIX for now because of dropped kdbus driver from Rawhide kernels.