Bug 681661

Summary: SELinux is preventing /usr/sbin/nscd from 'write' accesses on the sock_file log.
Product: [Fedora] Fedora Reporter: Thomas Meyer <thomas.mey>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dwalsh, mgrepl
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:dbe58fa1c410bd70356c82570f1c518fb319a22dafa5a7663695f8b17c61298e
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-07 22:29:01 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 Thomas Meyer 2011-03-02 21:00:41 UTC
SELinux is preventing /usr/sbin/nscd from 'write' accesses on the sock_file log.

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

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

Additional Information:
Source Context                system_u:system_r:nscd_t:s0
Target Context                system_u:object_r:tmpfs_t:s0
Target Objects                log [ sock_file ]
Source                        nscd
Source Path                   /usr/sbin/nscd
Port                          <Unbekannt>
Host                          (removed)
Source RPM Packages           nscd-2.13.90-4
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.15-2.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38-rc7 #265 Wed
                              Mar 2 19:29:44 CET 2011 i686 i686
Alert Count                   48
First Seen                    Di 22 Feb 2011 23:48:15 CET
Last Seen                     Mi 02 Mär 2011 21:50:39 CET
Local ID                      f0f07f3f-b795-405b-9f78-9dfbeb520aaa

Raw Audit Messages
type=AVC msg=audit(1299099039.813:485): avc:  denied  { write } for  pid=4068 comm="nscd" name="log" dev=tmpfs ino=14082 scontext=system_u:system_r:nscd_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=sock_file


type=SYSCALL msg=audit(1299099039.813:485): arch=i386 syscall=socketcall success=no exit=EACCES a0=3 a1=b735da34 a2=b76f8ff4 a3=0 items=0 ppid=1 pid=4068 auid=4294967295 uid=28 gid=494 euid=28 suid=28 fsuid=28 egid=494 sgid=494 fsgid=494 tty=(none) ses=4294967295 comm=nscd exe=/usr/sbin/nscd subj=system_u:system_r:nscd_t:s0 key=(null)

Hash: nscd,nscd_t,tmpfs_t,sock_file,write

audit2allow

#============= nscd_t ==============
allow nscd_t tmpfs_t:sock_file write;

audit2allow -R

#============= nscd_t ==============
allow nscd_t tmpfs_t:sock_file write;

Comment 1 Miroslav Grepl 2011-03-03 13:20:02 UTC
/dev/log is mislabeled.

I would try to relabel your system.

touch /.autorelabel; reboot

Comment 2 Thomas Meyer 2011-03-06 13:55:05 UTC
I did relabel the system. but today after a reboot I got the same error again:

$ ls -Z /dev/log
srw-rw-rw-. root root system_u:object_r:tmpfs_t:s0     /dev/log
$ sudo restorecon /dev/log 
$ ls -Z /dev/log
srw-rw-rw-. root root system_u:object_r:devlog_t:s0    /dev/log

something strange is going on here!

Comment 3 Daniel Walsh 2011-03-07 22:15:27 UTC
yum reinstall selinux-policy-targeted

ps -eZ | grep udev

Comment 4 Miroslav Grepl 2011-03-07 22:29:01 UTC

*** This bug has been marked as a duplicate of bug 682527 ***