Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 888440

Summary: Apcupsd SNMP monitoring blocked
Product: Red Hat Enterprise Linux 6 Reporter: Moray.Henderson
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: dwalsh, mmalik, tlavigne
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.7.19-190.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 08:33:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Moray.Henderson 2012-12-18 17:29:12 UTC
Description of problem:
apcupsd configured for SNMP crashes

Version-Release number of selected component (if applicable):
CentOS 6.3 (targeted policy 3.7.19) 

How reproducible:
Always

Steps to Reproduce:
1.  Configure apcupsd for snmp, for example
> UPSCABLE ether
> UPSTYPE snmp
> DEVICE 192.168.1.1:161:APC:private

2. SELinux in enforcing mode
3. service apcupsd start
  
Actual results:
It reports service started, but /var/log/messages contains
kernel: apcupsd[2117]: segfault at 8 ip 000000000040f36b sp 00007fff717afbb0 error 4 in apcupsd[400000+37000]


Expected results:
Daemon running; 'service apcupsd status' should report UPS status

Additional info:
----
time->Tue Dec 18 16:07:47 2012
type=SYSCALL msg=audit(1355846867.862:18629): arch=c000003e syscall=49 success=yes exit=0 a0=4 a1=7fffabaa61f0 a2=10 a3=7fffabaa5f30 items=0 ppid=1 pid=2162 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=2 comm="apcupsd" exe="/sbin/apcupsd" subj=unconfined_u:system_r:apcupsd_t:s0 key=(null) type=AVC msg=audit(1355846867.862:18629): avc:  denied  { node_bind } for  pid=2162 comm="apcupsd" scontext=unconfined_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:node_t:s0 tclass=udp_socket
----
time->Tue Dec 18 16:07:47 2012
type=SYSCALL msg=audit(1355846867.864:18630): arch=c000003e syscall=49 success=yes exit=0 a0=5 a1=7fffabaa61f0 a2=10 a3=7fffabaa5f30 items=0 ppid=1 pid=2162 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=2 comm="apcupsd" exe="/sbin/apcupsd" subj=unconfined_u:system_r:apcupsd_t:s0 key=(null) type=AVC msg=audit(1355846867.864:18630): avc:  denied  { net_bind_service } for  pid=2162 comm="apcupsd" capability=10  scontext=unconfined_u:system_r:apcupsd_t:s0 tcontext=unconfined_u:system_r:apcupsd_t:s0 tclass=capability type=AVC msg=audit(1355846867.864:18630): avc:  denied  { name_bind } for  pid=2162 comm="apcupsd" src=162 scontext=unconfined_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:snmp_port_t:s0 tclass=udp_socket

Dominick Grift's recommendation of 

  policy_module(myapcupsd, 1.0.0)
  gen_require(` type apcupsd_t; ')
  corenet_upd_bind_generic_node(apcupsd_t)
  corenet_udp_bind_snmp_port(apcupsd_t)

fixes it.

Comment 2 Daniel Walsh 2012-12-18 19:38:13 UTC
commit 80a5cb380cc1e9b430e9758178485ccc74a65fc1
 added to fedora 18

Comment 8 errata-xmlrpc 2013-02-21 08:33:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0314.html