Bug 912035

Summary: SELinux is preventing /usr/lib/systemd/systemd-hostnamed from 'write' accesses on the chr_file kmsg.
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: alexandredhont, artur.meski, autarch, beland, cyrusyzgtt, danielcolquitt, deanhunter, dominick.grift, dspurek, dwalsh, G.r.v.kroon, jack.gurulian, matbos, metanoite, mgrepl, mikhail.v.gavrilov, mkaczma, moez.roy, niki.guldbrand, oleg-sz, ondra.pelech, pethog, red, scottplough, shrijit.panicker, stefan998, thomas.citharet
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:5d2f8e88846009115150fa51720f7551dccb69e534e26c62e3a5bb083ebaf131
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-20 04:01:12 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 Mikhail 2013-02-17 10:59:31 UTC
Description of problem:
SELinux is preventing /usr/lib/systemd/systemd-hostnamed from 'write' accesses on the chr_file kmsg.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that systemd-hostnamed should be allowed write access on the kmsg chr_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:kmsg_device_t:s0
Target Objects                kmsg [ chr_file ]
Source                        systemd-hostnam
Source Path                   /usr/lib/systemd/systemd-hostnamed
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           systemd-197-1.fc18.2.i686
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-78.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.7.8-202.fc18.i686.PAE #1 SMP Fri
                              Feb 15 17:47:05 UTC 2013 i686 i686
Alert Count                   1
First Seen                    2013-02-17 16:58:24 YEKT
Last Seen                     2013-02-17 16:58:24 YEKT
Local ID                      98265ba7-ae5c-4bd2-a809-6aab21e71a82

Raw Audit Messages
type=AVC msg=audit(1361098704.506:340): avc:  denied  { write } for  pid=10179 comm="systemd-hostnam" name="kmsg" dev="devtmpfs" ino=1034 scontext=system_u:system_r:systemd_hostnamed_t:s0 tcontext=system_u:object_r:kmsg_device_t:s0 tclass=chr_file


type=SYSCALL msg=audit(1361098704.506:340): arch=i386 syscall=open success=no exit=EACCES a0=b7745410 a1=88101 a2=0 a3=6 items=0 ppid=1 pid=10179 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=systemd-hostnam exe=/usr/lib/systemd/systemd-hostnamed subj=system_u:system_r:systemd_hostnamed_t:s0 key=(null)

Hash: systemd-hostnam,systemd_hostnamed_t,kmsg_device_t,chr_file,write

audit2allow

#============= systemd_hostnamed_t ==============
allow systemd_hostnamed_t kmsg_device_t:chr_file write;

audit2allow -R

#============= systemd_hostnamed_t ==============
allow systemd_hostnamed_t kmsg_device_t:chr_file write;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.8-202.fc18.i686.PAE
type:           libreport

Comment 1 Miroslav Grepl 2013-02-18 10:42:10 UTC
commit 33a62dfff572a0954b36313132a99c8b4da2f02e
Author: Miroslav Grepl <mgrepl>
Date:   Mon Feb 18 11:40:44 2013 +0100

    Backport fixes for systemd-hostname policy to F18

Comment 2 Miroslav Grepl 2013-02-18 10:46:12 UTC
Please execute

# semanage permissive -a systemd_hostnamed_t

to make this working for now.

Comment 3 Guido Kroon 2013-02-18 22:35:44 UTC
Every time I open nautilus.

Package: (null)
Architecture: x86_64
OS Release: Fedora release 18 (Spherical Cow)

Comment 4 Fedora Update System 2013-02-19 09:29:42 UTC
selinux-policy-3.11.1-79.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-79.fc18

Comment 5 Niki Guldbrand 2013-02-19 23:59:32 UTC
Don't exactly know what happened...

Package: (null)
Architecture: x86_64
OS Release: Fedora release 18 (Spherical Cow)

Comment 6 Scott Plough 2013-02-20 01:27:18 UTC
After rebooting, and then logging in, it happened immately after launching Nautilus.

Package: (null)
Architecture: x86_64
OS Release: Fedora release 18 (Spherical Cow)

Comment 7 Fedora Update System 2013-02-20 04:01:15 UTC
selinux-policy-3.11.1-79.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.