Bug 728485

Summary: SELinux is preventing /bin/hostname from 'read' accesses on the file unix.
Product: [Fedora] Fedora Reporter: Jeff Layton <jlayton>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 15CC: dominick.grift, dwalsh, jlayton, mgrepl, steved
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:754a1cbd1db0331623f2aeb22e4b40513c741f20b88a093589cf40b391db3af8
Fixed In Version: selinux-policy-3.9.16-38.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-07 00:18:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jeff Layton 2011-08-05 10:26:08 UTC
SELinux is preventing /bin/hostname from 'read' accesses on the file unix.

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

If you believe that hostname should be allowed read access on the unix 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 dnsdomainname /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:hostname_t:s0
Target Context                system_u:object_r:proc_net_t:s0
Target Objects                unix [ file ]
Source                        dnsdomainname
Source Path                   /bin/hostname
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           hostname-3.05-2.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-35.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.40-4.fc15.x86_64
                              #1 SMP Fri Jul 29 18:46:53 UTC 2011 x86_64 x86_64
Alert Count                   2
First Seen                    Thu 04 Aug 2011 09:42:54 PM EDT
Last Seen                     Fri 05 Aug 2011 06:26:57 AM EDT
Local ID                      37e90470-02cd-4d26-b3f9-64a86b86ae38

Raw Audit Messages
type=AVC msg=audit(1312540017.335:68): avc:  denied  { read } for  pid=2047 comm="dnsdomainname" name="unix" dev=proc ino=4026532000 scontext=system_u:system_r:hostname_t:s0 tcontext=system_u:object_r:proc_net_t:s0 tclass=file


type=SYSCALL msg=audit(1312540017.335:68): arch=x86_64 syscall=access success=no exit=EACCES a0=7fff6d709590 a1=4 a2=7fff6d70959e a3=0 items=0 ppid=2044 pid=2047 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=dnsdomainname exe=/bin/hostname subj=system_u:system_r:hostname_t:s0 key=(null)

Hash: dnsdomainname,hostname_t,proc_net_t,file,read

audit2allow

#============= hostname_t ==============
allow hostname_t proc_net_t:file read;

audit2allow -R

#============= hostname_t ==============
allow hostname_t proc_net_t:file read;

Comment 1 Daniel Walsh 2011-08-05 14:37:02 UTC
Miroslav add

kernel_read_network_state(hostname_t)

to F14, F15, RHEL6 please.

Comment 2 Miroslav Grepl 2011-08-11 11:32:32 UTC
Added.

Fixed in selinux-policy-3.9.16-38.fc15

Comment 3 Fedora Update System 2011-08-11 20:38:57 UTC
selinux-policy-3.9.16-38.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-38.fc15

Comment 4 Fedora Update System 2011-08-12 18:19:36 UTC
Package selinux-policy-3.9.16-38.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.9.16-38.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-38.fc15
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2011-09-07 00:16:40 UTC
selinux-policy-3.9.16-38.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.