Bug 445860

Summary: libnss_wins.so generates a lot of selinux avc denials
Product: [Fedora] Fedora Reporter: Tomáš Bžatek <tbzatek>
Component: sambaAssignee: Simo Sorce <ssorce>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 9CC: tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-14 16:30:56 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 Tomáš Bžatek 2008-05-09 14:28:33 UTC
Description of problem:
  Having wins as a first hostname resolver option generates a lot of SELinux AVC
denials, because it's trying to access /etc/samba/smb.conf or ./smb.conf


Version-Release number of selected component (if applicable):
  samba-3.2.0-1.pre3.9.fc9.i386

How reproducible:
- The libnss_wins.so module affects all applications doing network name
resolution. If an application/daemon is confined by a selinux policy, every
attempt to access smb.conf can cause avc denial.
- So far these denials were observed from sshd, procmail, sendmail,
gnome-settings-daemon/"gdm-session-wor"

Steps to Reproduce:
1. Edit /etc/nsswitch.conf and put 'wins' as the first option on the 'hosts' line
  
Actual results:
- Basically there are two types of denials:

1.
SELinux is preventing sshd (sshd_t) "getattr" to /etc/samba/smb.conf
(samba_etc_t).

Additional Information:

Source Context                system_u:system_r:sshd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:samba_etc_t:s0
Target Objects                /etc/samba/smb.conf [ file ]
Source                        sshd
Source Path                   /usr/sbin/sshd
Port                          <Unknown>
Host                          vmrawhide.englab.brq.redhat.com
Source RPM Packages           openssh-server-5.0p1-1.fc9
Target RPM Packages           samba-common-3.2.0-1.pre3.10.fc9
Policy RPM                    selinux-policy-3.3.1-42.fc9
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall_file
Host Name                     vmrawhide.englab.brq.redhat.com
Platform                      Linux vmrawhide.englab.brq.redhat.com
                              2.6.25-14.fc9.i686 #1 SMP Thu May 1 06:28:41 EDT
                              2008 i686 i686
Alert Count                   15

Raw Audit Messages:

host=vmrawhide.englab.brq.redhat.com type=AVC msg=audit(1210332854.643:961):
avc:  denied  { getattr } for  pid=22552 comm="sshd" path="/etc/samba/smb.conf"
dev=dm-0 ino=1737231 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023
tcontext=system_u:object_r:samba_etc_t:s0 tclass=file

host=vmrawhide.englab.brq.redhat.com type=SYSCALL msg=audit(1210332854.643:961):
arch=40000003 syscall=195 success=no exit=-13 a0=b973d420 a1=bf9ee5d4 a2=6d6
ff4 a3=bf9ee5d4 items=0 ppid=2129 pid=22552 auid=4294967295 uid=0 gid=0 euid=0
suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="sshd" exe
="/usr/sbin/sshd" subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)



2.
SELinux is preventing sshd (sshd_t) "read" to ./smb.conf (samba_etc_t).

Additional Information:

Source Context                system_u:system_r:sshd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:samba_etc_t:s0
Target Objects                ./smb.conf [ file ]
Source                        sshd
Source Path                   /usr/sbin/sshd
Port                          <Unknown>
Host                          vmrawhide.englab.brq.redhat.com
Source RPM Packages           openssh-server-5.0p1-1.fc9
Target RPM Packages
Policy RPM                    selinux-policy-3.3.1-42.fc9
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall_file
Host Name                     vmrawhide.englab.brq.redhat.com
Platform                      Linux vmrawhide.englab.brq.redhat.com
                              2.6.25-14.fc9.i686 #1 SMP Thu May 1 06:28:41 EDT
                              2008 i686 i686
Alert Count                   15

Raw Audit Messages:

host=vmrawhide.englab.brq.redhat.com type=AVC msg=audit(1210332854.650:962):
avc:  denied  { read } for  pid=22552 comm="sshd" name="smb.conf" dev=dm-0 ino=1
737231 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023
tcontext=system_u:object_r:samba_etc_t:s0 tclass=file

host=vmrawhide.englab.brq.redhat.com type=SYSCALL msg=audit(1210332854.650:962):
arch=40000003 syscall=5 success=no exit=-13 a0=b973d420 a1=8000 a2=0 a3=8000
 items=0 ppid=2129 pid=22552 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0
egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="sshd" exe="/usr/sbin/ssh
d" subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)

Comment 1 Bug Zapper 2008-05-14 10:55:06 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Bug Zapper 2009-06-10 00:42:29 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Bug Zapper 2009-07-14 16:30:56 UTC
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.