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 889120 - AVC denials for sanlock and fence_sanlock
Summary: AVC denials for sanlock and fence_sanlock
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-20 09:32 UTC by michal novacek
Modified: 2013-11-21 10:11 UTC (History)
2 users (show)

Fixed In Version: selinux-policy-3.7.19-223.el6
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-21 10:11:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
AVC denials log filtered (3.00 KB, text/plain)
2012-12-20 09:32 UTC, michal novacek
no flags Details
AVC denials log complete (43.99 KB, text/plain)
2012-12-20 09:33 UTC, michal novacek
no flags Details
/etc/cluster/cluster.conf (2.02 KB, text/plain)
2012-12-20 09:34 UTC, michal novacek
no flags Details
avc denials after proposed fix in comment #9 (4.43 KB, text/plain)
2012-12-21 11:51 UTC, michal novacek
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1598 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2013-11-20 21:39:24 UTC

Description michal novacek 2012-12-20 09:32:04 UTC
Description of problem:
AVC denials.

Version-Release number of selected component (if applicable):
RHEL-6.4-candidate-20121217
selinux-policy-3.7.19-187.el6.noarch

Steps to Reproduce:
1) have two node cluster with both nodes in selinux permissive
2) yum -y install fence-sanlock sanlock sanlock-lib
3) change /etc/cluster/cluster.conf to the attached version and 
    "cman_tool version -r" to distribute to the other node
4) fence_sanlock -o sanlock_init -p /dev/vdb
5) chkconfig wdmd off
6) chkconfig sanlock off
7) chkconfig fence_sanlockd on
8) chkconfig cman on
9) reboot both nodes
10) collect denial messages

Comment 1 michal novacek 2012-12-20 09:32:48 UTC
Created attachment 666562 [details]
AVC denials log filtered

Comment 2 michal novacek 2012-12-20 09:33:25 UTC
Created attachment 666563 [details]
AVC denials log complete

Comment 4 michal novacek 2012-12-20 09:34:07 UTC
Created attachment 666564 [details]
/etc/cluster/cluster.conf

Comment 5 Milos Malik 2012-12-20 10:38:16 UTC
Following AVC appeared in enforcing mode:
----
time->Thu Dec 20 13:35:22 2012
type=PATH msg=audit(1356006922.828:3246): item=0 name="/usr/sbin/sanlock" inode=4207261 dev=08:03 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:sanlock_exec_t:s0
type=CWD msg=audit(1356006922.828:3246):  cwd="/"
type=SYSCALL msg=audit(1356006922.828:3246): arch=c000003e syscall=4 success=no exit=-13 a0=1ebcea0 a1=7fff5e819e60 a2=7fff5e819e60 a3=12 items=1 ppid=12921 pid=12922 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=450 comm="fence_sanlock" exe="/bin/bash" subj=unconfined_u:system_r:fenced_t:s0 key=(null)
type=AVC msg=audit(1356006922.828:3246): avc:  denied  { getattr } for  pid=12922 comm="fence_sanlock" path="/usr/sbin/sanlock" dev=sda3 ino=4207261 scontext=unconfined_u:system_r:fenced_t:s0 tcontext=system_u:object_r:sanlock_exec_t:s0 tclass=file
----

Comment 6 Milos Malik 2012-12-20 10:39:58 UTC
Following AVCs appeared in permissive mode:
----
time->Thu Dec 20 13:37:39 2012
type=PATH msg=audit(1356007059.975:3248): item=0 name="/usr/sbin/sanlock" inode=4207261 dev=08:03 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:sanlock_exec_t:s0
type=CWD msg=audit(1356007059.975:3248):  cwd="/"
type=SYSCALL msg=audit(1356007059.975:3248): arch=c000003e syscall=4 success=yes exit=0 a0=1254ea0 a1=7fffa18bdc50 a2=7fffa18bdc50 a3=12 items=1 ppid=13290 pid=13291 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=450 comm="fence_sanlock" exe="/bin/bash" subj=unconfined_u:system_r:fenced_t:s0 key=(null)
type=AVC msg=audit(1356007059.975:3248): avc:  denied  { getattr } for  pid=13291 comm="fence_sanlock" path="/usr/sbin/sanlock" dev=sda3 ino=4207261 scontext=unconfined_u:system_r:fenced_t:s0 tcontext=system_u:object_r:sanlock_exec_t:s0 tclass=file
----
time->Thu Dec 20 13:37:39 2012
type=PATH msg=audit(1356007059.975:3249): item=0 name="/usr/sbin/sanlock" inode=4207261 dev=08:03 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:sanlock_exec_t:s0
type=CWD msg=audit(1356007059.975:3249):  cwd="/"
type=SYSCALL msg=audit(1356007059.975:3249): arch=c000003e syscall=21 success=yes exit=0 a0=1254ea0 a1=1 a2=0 a3=7fffa18bd9d0 items=1 ppid=13290 pid=13291 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=450 comm="fence_sanlock" exe="/bin/bash" subj=unconfined_u:system_r:fenced_t:s0 key=(null)
type=AVC msg=audit(1356007059.975:3249): avc:  denied  { execute } for  pid=13291 comm="fence_sanlock" name="sanlock" dev=sda3 ino=4207261 scontext=unconfined_u:system_r:fenced_t:s0 tcontext=system_u:object_r:sanlock_exec_t:s0 tclass=file
----
time->Thu Dec 20 13:37:39 2012
type=PATH msg=audit(1356007059.975:3250): item=0 name="/usr/sbin/sanlock" inode=4207261 dev=08:03 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:sanlock_exec_t:s0
type=CWD msg=audit(1356007059.975:3250):  cwd="/"
type=SYSCALL msg=audit(1356007059.975:3250): arch=c000003e syscall=21 success=yes exit=0 a0=1254ea0 a1=4 a2=0 a3=7fffa18bd9d0 items=1 ppid=13290 pid=13291 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=450 comm="fence_sanlock" exe="/bin/bash" subj=unconfined_u:system_r:fenced_t:s0 key=(null)
type=AVC msg=audit(1356007059.975:3250): avc:  denied  { read } for  pid=13291 comm="fence_sanlock" name="sanlock" dev=sda3 ino=4207261 scontext=unconfined_u:system_r:fenced_t:s0 tcontext=system_u:object_r:sanlock_exec_t:s0 tclass=file
----
time->Thu Dec 20 13:37:39 2012
type=PATH msg=audit(1356007059.976:3251): item=1 name=(null) inode=6032943 dev=08:03 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:ld_so_t:s0
type=PATH msg=audit(1356007059.976:3251): item=0 name="/usr/sbin/sanlock" inode=4207261 dev=08:03 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:sanlock_exec_t:s0
type=CWD msg=audit(1356007059.976:3251):  cwd="/"
type=EXECVE msg=audit(1356007059.976:3251): argc=5 a0="sanlock" a1="direct" a2="read_leader" a3="-r" a4="fence:h1:/dev/vdb:1048576"
type=SYSCALL msg=audit(1356007059.976:3251): arch=c000003e syscall=59 success=yes exit=0 a0=1254ea0 a1=1270590 a2=12705d0 a3=7fffa18bdac0 items=2 ppid=13291 pid=13292 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=450 comm="sanlock" exe="/usr/sbin/sanlock" subj=unconfined_u:system_r:fenced_t:s0 key=(null)
type=AVC msg=audit(1356007059.976:3251): avc:  denied  { execute_no_trans } for  pid=13292 comm="fence_sanlock" path="/usr/sbin/sanlock" dev=sda3 ino=4207261 scontext=unconfined_u:system_r:fenced_t:s0 tcontext=system_u:object_r:sanlock_exec_t:s0 tclass=file
type=AVC msg=audit(1356007059.976:3251): avc:  denied  { open } for  pid=13292 comm="fence_sanlock" name="sanlock" dev=sda3 ino=4207261 scontext=unconfined_u:system_r:fenced_t:s0 tcontext=system_u:object_r:sanlock_exec_t:s0 tclass=file
----

Comment 7 Milos Malik 2012-12-20 10:47:29 UTC
fence_sanlockd runs as initrc_t. Could we fix it within this bug or should I file a new bug?

Comment 8 Milos Malik 2012-12-20 10:57:15 UTC
How important is the fix for your team? Please assign priority/severity.

Comment 9 Miroslav Grepl 2012-12-20 11:58:51 UTC
Also could you test it with

# cat mypol.te
policy_module(mypol,1.0)

require{
 type fenced_t;
 type sanlock_exec_t;
 type sanlock_t;
}

domtrans_pattern(fenced_t, sanlock_exec_t, sanlock_exec_t)



and execute

# make -f /usr/share/selinux/devel/Makefile mypol.pp
# semodule -i mypol.pp
# chcon -t sanlock_exec_t PATHO/fence_sanlockd

Comment 10 michal novacek 2012-12-21 11:19:07 UTC
It's not too important as it is FutureFeature (I put that into keyword) but it should be fixed eventually. 

It can be changed in this bug I do not need another one.

Comment 11 michal novacek 2012-12-21 11:51:13 UTC
Created attachment 667192 [details]
avc denials after proposed fix in comment #9

Comment 12 RHEL Program Management 2012-12-25 06:47:09 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 16 Miroslav Grepl 2013-10-15 12:58:30 UTC
# matchpathcon /usr/sbin/fence_sanlockd
/usr/sbin/fence_sanlockd	system_u:object_r:fenced_exec_t:s0

Comment 19 errata-xmlrpc 2013-11-21 10:11:39 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-1598.html


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