Bug 185296 - snmpd generates avc: denied messages
snmpd generates avc: denied messages
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: selinux-policy-targeted (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Russell Coker
:
Depends On:
Blocks: 181409
  Show dependency treegraph
 
Reported: 2006-03-13 08:06 EST by Peter Bieringer
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version: RHBA-2006-0373
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-10 17:20:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter Bieringer 2006-03-13 08:06:54 EST
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 13:06:49 EDT
Fixed in  selinux-policy-targeted-1.17.30-2.132
Comment 8 Red Hat Bugzilla 2006-08-10 17:20:20 EDT
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 08:55:14 EDT
Confirming problem is fixed.
Comment 10 Peter Bieringer 2006-09-26 06:49:13 EDT
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 10:51:42 EDT
Are  you running in permissive mode on this machine and enforcing on the others?

Comment 12 Peter Bieringer 2006-10-04 08:16:03 EDT
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 09:53:18 EDT
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 10:48:06 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.