Bug 2049481

Summary: ocf:heartbeat:CTDB resource start is blocked by selinux
Product: Red Hat Enterprise Linux 8 Reporter: Martin Juricek <mjuricek>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.6CC: lvrabec, mmalik, ssekidde
Target Milestone: rcKeywords: Triaged
Target Release: 8.6Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.14.3-92.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 15:15:49 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:

Comment 1 Zdenek Pytela 2022-02-02 11:28:01 UTC
Martine,

What filesystem is on dm-4 and how it was created? The unlabeled_t type indicates it was created with SELinux disabled.

----
type=PROCTITLE msg=audit(2.2.2022 11:04:58.960:143) : proctitle=/usr/libexec/ctdb/ctdb_mutex_fcntl_helper /mnt/shared0/ctdb/ctdb.lock
type=AVC msg=audit(2.2.2022 11:04:58.960:143) : avc:  denied  { search } for  pid=43217 comm=ctdb_mutex_fcnt name=/ dev="dm-4" ino=25441 scontext=system_u:system_r:ctdbd_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir permissive=1
type=SYSCALL msg=audit(2.2.2022 11:04:58.960:143) : arch=x86_64 syscall=openat success=yes exit=4 a0=AT_FDCWD a1=0x7fffee0598d6 a2=O_RDWR|O_CREAT a3=0x180 items=2 ppid=42953 pid=43217 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=ctdb_mutex_fcnt exe=/usr/libexec/ctdb/ctdb_mutex_fcntl_helper subj=system_u:system_r:ctdbd_t:s0 key=(null)
type=CWD msg=audit(2.2.2022 11:04:58.960:143) : cwd=/var/lib/pacemaker/cores
type=PATH msg=audit(2.2.2022 11:04:58.960:143) : item=0 name=/mnt/shared0/ctdb/ inode=1840980 dev=fd:04 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=unconfined_u:object_r:ctdbd_var_run_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
type=PATH msg=audit(2.2.2022 11:04:58.960:143) : item=1 name=/mnt/shared0/ctdb/ctdb.lock inode=1905849 dev=fd:04 mode=file,600 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:ctdbd_var_run_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0

Comment 3 Zdenek Pytela 2022-02-10 15:46:33 UTC
I've submitted a Fedora PR to address the issue:
https://github.com/fedora-selinux/selinux-policy/pull/1062

To resolve the other problem: the filesystem root needs to be assigned a proper label.

Comment 4 Zdenek Pytela 2022-02-11 10:49:50 UTC
To backport:
commit d690c06f2d838e1d642a99105924bb2b70d22665 (HEAD -> rawhide, upstream/rawhide)
Author: Zdenek Pytela <zpytela>
Date:   Thu Feb 10 16:33:46 2022 +0100

    Allow ctdb create cluster logs

Comment 14 errata-xmlrpc 2022-05-10 15:15: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 (selinux-policy bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2022:1995