Bug 185296

Summary: snmpd generates avc: denied messages
Product: Red Hat Enterprise Linux 4 Reporter: Peter Bieringer <pb>
Component: selinux-policy-targetedAssignee: Russell Coker <rcoker>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2006-0373 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-10 21:20: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:
Bug Depends On:    
Bug Blocks: 181409    

Description Peter Bieringer 2006-03-13 13:06:54 UTC
Description of problem:
snmpd generates avc:  denied messages

Version-Release number of selected component (if applicable):
selinux-policy-targeted-1.17.30-2.126
net-snmp-5.1.2-11.EL4.6

How reproducible:
Always

Steps to Reproduce:
1. Install current policy
2. restart snmpd
  
Actual results:

In permissive mode:
Mar 13 13:54:44 server audit(1142254484.990:17): avc:  denied  { read } for 
pid=7817 comm="snmpd" name="config" dev=md1 ino=321329
scontext=user_u:system_r:snmpd_t tcontext=system_u:object_r:selinux_config_t
tclass=file

Mar 13 13:54:44 server audit(1142254484.991:18): avc:  denied  { getattr } for 
pid=7817 comm="snmpd" name="config" dev=md1 ino=321329
scontext=user_u:system_r:snmpd_t tcontext=system_u:object_r:selinux_config_t
tclass=file

Mar 13 13:54:45 server audit(1142254485.009:19): avc:  denied  { search } for 
pid=7819 comm="snmpd" scontext=user_u:system_r:snmpd_t
tcontext=system_u:object_r:sysctl_dev_t tclass=dir


In enforcing mode:

Mar 13 14:06:14 pog audit(1142255174.341:30): avc:  denied  { search } for 
pid=9023 comm="snmpd" scontext=user_u:system_r:snmpd_t
tcontext=system_u:object_r:sysctl_dev_t tclass=dir

But daemon is still running afterwards.



Expected results:

No such messages.

Additional info:

following local selinux ruleset extension will fix this temporary.
allow snmpd_t selinux_config_t:file { getattr read };
allow snmpd_t sysctl_dev_t:dir search;

If setsebool snmpd_disable_trans=1, no such messages occur.

Comment 1 Daniel Walsh 2006-04-03 17:06:49 UTC
Fixed in  selinux-policy-targeted-1.17.30-2.132

Comment 8 Red Hat Bugzilla 2006-08-10 21:20:20 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0373.html


Comment 9 Peter Bieringer 2006-09-14 12:55:14 UTC
Confirming problem is fixed.

Comment 10 Peter Bieringer 2006-09-26 10:49:13 UTC
Hmm, while problem is gone on 2 other systems, it stays on one system which is
similar to one of the others:

Sep 26 12:40:55 server audit(1159267255.028:1807): avc:  denied  { read } for 
pid=26075 comm="snmpd" name="config" dev=md1 ino=177784
scontext=root:system_r:snmpd_t tcontext=system_u:object_r:selinux_config_t
tclass=file
Sep 26 12:40:55 server audit(1159267255.028:1808): avc:  denied  { getattr } for
 pid=26075 comm="snmpd" name="config" dev=md1 ino=177784
scontext=root:system_r:snmpd_t tcontext=system_u:object_r:selinux_config_t
tclass=file


# ls -Z /dev/md1
brw-rw----  root     disk     system_u:object_r:fixed_disk_device_t /dev/md1

is identically on both systems.

Can one please point me where to look deeper for comparing?

Comment 11 Daniel Walsh 2006-09-26 14:51:42 UTC
Are  you running in permissive mode on this machine and enforcing on the others?



Comment 12 Peter Bieringer 2006-10-04 12:16:03 UTC
Both are in permissive mode. I checked another box (different setup), running
selinux-policy-targeted-1.17.30-2.140. Here it occurs, too on "service snmpd
restart".

Do you have any hints how to debug this issue?

Comment 13 Daniel Walsh 2006-10-04 13:53:18 UTC
We do not care about avc messages in permissive mode.  The way the policy works
is we have a dontaudit when trying to read the /etc/selinux directory.  Which in
enforcing mode would prevent the app from continuing.  So no AVC would be
generated, but in permissive mode the app continues and tries to read files that
it is not allowed (by policy) to read.  So AVC's are generated.  

So only if you can generate these avc's in enforcing, it is a bug.

Comment 14 Peter Bieringer 2006-10-04 14:48:06 UTC
I've tried now with selinux in enforcing mode on both nodes and as you expected,
the messages are gone now. Funny that even on one system with has still
permissive mode, such message didn't appear, while it is mostly identical to one
of the others. Anyway, reason is now known, thank you for assistance.