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 1286030 - restorecon sets an incorrect label on /var/lock/LCK.. (created by apcupsd)
Summary: restorecon sets an incorrect label on /var/lock/LCK.. (created by apcupsd)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.7
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Simon Sekidde
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-27 09:57 UTC by Milos Malik
Modified: 2016-05-10 20:02 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-3.7.19-286.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-10 20:02:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0763 0 normal SHIPPED_LIVE selinux-policy bug fix update 2016-05-10 22:33:46 UTC

Description Milos Malik 2015-11-27 09:57:53 UTC
Description of problem:
# restorecon -Rv /var
restorecon reset /var/lock/LCK.. context unconfined_u:object_r:apcupsd_lock_t:s0->unconfined_u:object_r:var_lock_t:s0
# 

Version-Release number of selected component (if applicable):
apcupsd-3.14.12-1.el6.x86_64
apcupsd-cgi-3.14.12-1.el6.x86_64
selinux-policy-3.7.19-279.el6.noarch
selinux-policy-targeted-3.7.19-279.el6.noarch

How reproducible:
 * always

Steps to Reproduce:
1. get a RHEL-6.7 machine (active targeted policy)
2. start the apcupsd service
3. restorecon -Rv /var
4. stop the apcupsd service
5. search for SELinux denials

Actual results (enforcing mode):
----
type=PATH msg=audit(11/27/2015 04:54:50.269:362) : item=0 name=/var/lock/LCK.. inode=135046 dev=fc:01 mode=file,644 ouid=root ogid=root rdev=00:00 obj=unconfined_u:object_r:var_lock_t:s0 nametype=NORMAL 
type=CWD msg=audit(11/27/2015 04:54:50.269:362) :  cwd=/ 
type=SYSCALL msg=audit(11/27/2015 04:54:50.269:362) : arch=x86_64 syscall=open success=no exit=-13(Permission denied) a0=0xbf32ac a1=O_RDONLY a2=0x20 a3=0x7f4e91f8ca20 items=1 ppid=1 pid=2506 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=4 comm=apcupsd exe=/sbin/apcupsd subj=unconfined_u:system_r:apcupsd_t:s0 key=(null) 
type=AVC msg=audit(11/27/2015 04:54:50.269:362) : avc:  denied  { read } for  pid=2506 comm=apcupsd name=LCK.. dev=vda1 ino=135046 scontext=unconfined_u:system_r:apcupsd_t:s0 tcontext=unconfined_u:object_r:var_lock_t:s0 tclass=file 
----

Expected results:
 * no SELinux denials
# matchpathcon /var/lock/LCK.. 
/var/lock/LCK..	system_u:object_r:apcupsd_lock_t:s0
#

Comment 1 Miroslav Grepl 2015-11-30 12:01:12 UTC
Ok we have

/var/lock/subsys/apcupsd    --  gen_context(system_u:object_r:apcupsd_lock_t,s0)
/var/lock/LCK..         --  gen_context(system_u:object_r:apcupsd_lock_t,s0)


labeling in RHEL-7.

Comment 2 Milos Malik 2015-12-03 10:28:01 UTC
If SSSD is running and nsswitch.conf is configured in certain way then following AVC appears in enforcing mode:
----
type=PATH msg=audit(12/03/2015 11:18:45.061:61) : item=0 name=(null) inode=25543 dev=fc:03 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:sssd_var_lib_t:s0 nametype=NORMAL 
type=SOCKADDR msg=audit(12/03/2015 11:18:45.061:61) : saddr=local /var/lib/sss/pipes/nss 
type=SYSCALL msg=audit(12/03/2015 11:18:45.061:61) : arch=x86_64 syscall=connect success=no exit=-13(Permission denied) a0=0x3 a1=0x7ffd7b1cb550 a2=0x6e a3=0x7ffd7b1cb1e0 items=1 ppid=5697 pid=5708 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=tty sgid=tty fsgid=tty tty=(none) ses=1 comm=wall exe=/usr/bin/wall subj=unconfined_u:system_r:apcupsd_t:s0 key=(null) 
type=AVC msg=audit(12/03/2015 11:18:45.061:61) : avc:  denied  { search } for  pid=5708 comm=wall name=sss dev=vda3 ino=25543 scontext=unconfined_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=dir 
----

The denial is usually accompanied by following messages in the terminal:
# 
Broadcast message from root (Thu Dec  3 11:24:36 2015):

Warning communications lost with UPS 

#

Comment 3 Milos Malik 2015-12-03 10:34:32 UTC
Following AVCs appeared in permissive mode:
----
type=PATH msg=audit(12/03/2015 11:31:14.957:133) : item=0 name=/var/lib/sss/mc/passwd inode=437 dev=fc:03 mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:sssd_public_t:s0 nametype=NORMAL 
type=CWD msg=audit(12/03/2015 11:31:14.957:133) :  cwd=/ 
type=SYSCALL msg=audit(12/03/2015 11:31:14.957:133) : arch=x86_64 syscall=open success=yes exit=3 a0=0x9822f0 a1=O_RDONLY|O_CLOEXEC a2=0x7ffc1816e12c a3=0x7ffc1816ddd0 items=1 ppid=10213 pid=10606 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=1 comm=apccontrol exe=/bin/bash subj=unconfined_u:system_r:apcupsd_t:s0 key=(null) 
type=AVC msg=audit(12/03/2015 11:31:14.957:133) : avc:  denied  { open } for  pid=10606 comm=apccontrol name=passwd dev=vda3 ino=437 scontext=unconfined_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=file 
type=AVC msg=audit(12/03/2015 11:31:14.957:133) : avc:  denied  { read } for  pid=10606 comm=apccontrol name=passwd dev=vda3 ino=437 scontext=unconfined_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=file 
type=AVC msg=audit(12/03/2015 11:31:14.957:133) : avc:  denied  { search } for  pid=10606 comm=apccontrol name=mc dev=vda3 ino=25545 scontext=unconfined_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=dir 
type=AVC msg=audit(12/03/2015 11:31:14.957:133) : avc:  denied  { search } for  pid=10606 comm=apccontrol name=sss dev=vda3 ino=25543 scontext=unconfined_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=dir 
----
type=SYSCALL msg=audit(12/03/2015 11:31:14.961:134) : arch=x86_64 syscall=fstat success=yes exit=0 a0=0x3 a1=0x7ffc1816e090 a2=0x7ffc1816e090 a3=0x7ffc1816de00 items=0 ppid=10213 pid=10606 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=1 comm=apccontrol exe=/bin/bash subj=unconfined_u:system_r:apcupsd_t:s0 key=(null) 
type=AVC msg=audit(12/03/2015 11:31:14.961:134) : avc:  denied  { getattr } for  pid=10606 comm=apccontrol path=/var/lib/sss/mc/passwd dev=vda3 ino=437 scontext=unconfined_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=file 
----
type=PATH msg=audit(12/03/2015 11:31:14.961:135) : item=0 name=(null) inode=370 dev=fc:03 mode=socket,666 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:sssd_var_lib_t:s0 nametype=NORMAL 
type=SOCKADDR msg=audit(12/03/2015 11:31:14.961:135) : saddr=local /var/lib/sss/pipes/nss 
type=SYSCALL msg=audit(12/03/2015 11:31:14.961:135) : arch=x86_64 syscall=connect success=yes exit=0 a0=0x4 a1=0x7ffc1816e0f0 a2=0x6e a3=0x7ffc1816dd80 items=1 ppid=10213 pid=10606 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=1 comm=apccontrol exe=/bin/bash subj=unconfined_u:system_r:apcupsd_t:s0 key=(null) 
type=AVC msg=audit(12/03/2015 11:31:14.961:135) : avc:  denied  { connectto } for  pid=10606 comm=apccontrol path=/var/lib/sss/pipes/nss scontext=unconfined_u:system_r:apcupsd_t:s0 tcontext=system_u:system_r:sssd_t:s0 tclass=unix_stream_socket 
type=AVC msg=audit(12/03/2015 11:31:14.961:135) : avc:  denied  { write } for  pid=10606 comm=apccontrol name=nss dev=vda3 ino=370 scontext=unconfined_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=sock_file 
----

Comment 8 errata-xmlrpc 2016-05-10 20:02:49 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.

https://rhn.redhat.com/errata/RHBA-2016-0763.html


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