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 754646 - SELinux is preventing /usr/sbin/sanlock from search access on NFS directory
Summary: SELinux is preventing /usr/sbin/sanlock from search access on NFS directory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.2
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: 784586
TreeView+ depends on / blocked
 
Reported: 2011-11-17 08:45 UTC by Alex Jia
Modified: 2012-06-20 12:29 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 784586 (view as bug list)
Environment:
Last Closed: 2012-06-20 12:29:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0780 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2012-06-19 20:34:59 UTC

Description Alex Jia 2011-11-17 08:45:34 UTC
Description of problem:
Sanlock should be allowed search access on the  directory by default.

Version-Release number of selected component (if applicable):
sanlock-1.8-2.el6
selinux-policy-3.7.19-126.el6
libvirt-lock-sanlock-0.9.4-23.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. following this link:
http://fedoraproject.org/wiki/Features/VirtLockManager  (see 'Dual host testing' section)

2. and enable the following selinux booleans:
virt_use_nfs --> on
virt_use_sanlock --> on

  
Actual results:
"AVC" error in /var/log/audit/audit.log.

Expected results:
allow sanlock search access.

Additional Information:
Source Context                unconfined_u:system_r:sanlock_t:s0-s0:c0.c1023
Target Context                system_u:object_r:nfs_t:s0
Target Objects                 [ dir ]
Source                        sanlock
Source Path                   /usr/sbin/sanlock
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           sanlock-1.8-2.el6
Target RPM Packages
Policy RPM                    selinux-policy-3.7.19-126.el6
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 2.6.32-220.el6.x86_64
                              #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64
Alert Count                   6
First Seen                    Thu 17 Nov 2011 03:16:29 PM CST
Last Seen                     Thu 17 Nov 2011 03:39:34 PM CST
Local ID                      6573384f-1045-476a-9bb6-d024af5182f6

Raw Audit Messages
type=AVC msg=audit(1321515574.664:90425): avc:  denied  { search } for  pid=22546 comm="sanlock" name="" dev=0:1e ino=1703968 scontext=unconfined_u:system_r:sanlock_t:s0-s0:c0.c1023 tcontext=system_u:object_r:nfs_t:s0 tclass=dir


type=AVC msg=audit(1321515574.664:90425): avc:  denied  { open } for  pid=22546 comm="sanlock" name="acd114944f033ea5cbcb8956d389469e" dev=0:1e ino=1705403 scontext=unconfined_u:system_r:sanlock_t:s0-s0:c0.c1023 tcontext=system_u:object_r:nfs_t:s0 tclass=file


type=SYSCALL msg=audit(1321515574.664:90425): arch=x86_64 syscall=open success=yes exit=ENOEXEC a0=7fc0ec000af8 a1=105002 a2=0 a3=0 items=0 ppid=1 pid=22546 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=168 comm=sanlock exe=/usr/sbin/sanlock subj=unconfined_u:system_r:sanlock_t:s0-s0:c0.c1023 key=(null)

Hash: sanlock,sanlock_t,nfs_t,dir,search

audit2allow

#============= sanlock_t ==============
#!!!! This avc is allowed in the current policy

allow sanlock_t nfs_t:dir search;
#!!!! This avc is allowed in the current policy

allow sanlock_t nfs_t:file open;

audit2allow -R

#============= sanlock_t ==============
#!!!! This avc is allowed in the current policy

allow sanlock_t nfs_t:dir search;
#!!!! This avc is allowed in the current policy

allow sanlock_t nfs_t:file open;

Comment 1 Miroslav Grepl 2011-11-17 09:21:54 UTC
We will need to add the same boolean which we have for virtd

sanlock_use_nfs

Comment 2 Miroslav Grepl 2011-11-21 09:30:56 UTC
Added to Fedora.

Comment 10 Milos Malik 2012-04-12 15:15:31 UTC
Hi Dave, could you help us? Why is wdmd calling chown() ? Is it because of /dev/watchdog ?

Comment 11 David Teigland 2012-04-12 15:29:10 UTC
The wdmd daemon is run as "wdmd -G sanlock".
Then socket_gid = group_to_gid("sanlock"), (using getgrnam)
Then it chowns its unix socket to socket_gid so that the
sanlock daemon can connect to it.

http://git.fedorahosted.org/git?p=sanlock.git;a=blob;f=wdmd/main.c;h=18a4109dff5240330748675f2836e537cacdc39d;hb=HEAD#l342

Comment 12 David Teigland 2012-04-12 15:31:14 UTC
The socket is /var/run/wdmd/wdmd.sock

Comment 13 Daniel Walsh 2012-04-13 16:15:41 UTC
Ok I guess we need to allow it.

Comment 16 errata-xmlrpc 2012-06-20 12:29:00 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-2012-0780.html


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