Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 889120 - AVC denials for sanlock and fence_sanlock
AVC denials for sanlock and fence_sanlock
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy (Show other bugs)
6.4
All Linux
medium Severity medium
: rc
: ---
Assigned To: Miroslav Grepl
Milos Malik
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-20 04:32 EST by michal novacek
Modified: 2013-11-21 05:11 EST (History)
2 users (show)

See Also:
Fixed In Version: selinux-policy-3.7.19-223.el6
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-21 05:11:39 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1598 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2013-11-20 16:39:24 EST

  None (edit)
Description michal novacek 2012-12-20 04:32:04 EST
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 04:32:48 EST
Created attachment 666562 [details]
AVC denials log filtered
Comment 2 michal novacek 2012-12-20 04:33:25 EST
Created attachment 666563 [details]
AVC denials log complete
Comment 4 michal novacek 2012-12-20 04:34:07 EST
Created attachment 666564 [details]
/etc/cluster/cluster.conf
Comment 5 Milos Malik 2012-12-20 05:38:16 EST
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 05:39:58 EST
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 05:47:29 EST
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 05:57:15 EST
How important is the fix for your team? Please assign priority/severity.
Comment 9 Miroslav Grepl 2012-12-20 06:58:51 EST
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 06:19:07 EST
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 06:51:13 EST
Created attachment 667192 [details]
avc denials after proposed fix in comment #9
Comment 12 RHEL Product and Program Management 2012-12-25 01:47:09 EST
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 08:58:30 EDT
# matchpathcon /usr/sbin/fence_sanlockd
/usr/sbin/fence_sanlockd	system_u:object_r:fenced_exec_t:s0
Comment 19 errata-xmlrpc 2013-11-21 05:11:39 EST
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.