Bug 1779052 - RHVH 4.4: AVC denied errors (dac_override) in audit.log
Summary: RHVH 4.4: AVC denied errors (dac_override) in audit.log
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: redhat-virtualization-host
Version: 4.4.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ovirt-4.4.6
: ---
Assignee: Lev Veyde
QA Contact: cshao
URL:
Whiteboard:
Depends On: 1937300
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-03 07:29 UTC by cshao
Modified: 2021-06-03 10:25 UTC (History)
13 users (show)

Fixed In Version: redhat-virtualization-host-4.4.6-20210402.2.el8_4 , glusterfs-selinux-1.0-3.el8rhgs.noarch
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-03 10:24:29 UTC
oVirt Team: Node
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
all log info (2.24 MB, application/gzip)
2019-12-03 07:29 UTC, cshao
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 496 0 None closed Adds rule to allow glusterd to access RDMA socket 2021-03-04 12:47:44 UTC
Github gluster glusterfs-selinux pull 18 0 None open Adds rule to allow glusterd to access RDMA socket 2021-03-09 09:41:16 UTC
Red Hat Product Errata RHSA-2021:2239 0 None None None 2021-06-03 10:25:14 UTC

Description cshao 2019-12-03 07:29:00 UTC
Created attachment 1641564 [details]
all log info

Description of problem:
RHVH 4.4: AVC denied errors (dac_override) in audit.log

Version-Release number of selected component (if applicable):
redhat-virtualization-host-4.4.0-20191201.0.el8_1

How reproducible:
80%


Steps to Reproduce:
1. RHVH-4.4-20191201.7-RHVH-x86_64-dvd1.iso installed successful. Selinux in enforcing mode as default.
2. Login to RHVH and run "grep "avc:  denied" /var/log/audit/audit.log".
3.

Actual results:
#  grep "avc:  denied" /var/log/audit/audit.log
type=AVC msg=audit(1575354047.697:51): avc:  denied  { dac_override } for  pid=2882 comm="firewalld" capability=1  scontext=system_u:system_r:firewalld_t:s0 tcontext=system_u:system_r:firewalld_t:s0 tclass=capability permissive=0

Expected results:
No AVC denied errors in audit.log

Additional info:

Comment 1 cshao 2020-02-07 03:35:59 UTC
Update with the latest 4.4 host.
# imgbase  w 
You are on rhvh-4.4.0.12-0.20200205.0+1

#  grep "avc:  denied" /var/log/audit/audit.log
type=AVC msg=audit(1580981055.672:35): avc:  denied  { create } for  pid=1653 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0
type=AVC msg=audit(1580981055.672:36): avc:  denied  { create } for  pid=1653 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0
type=AVC msg=audit(1580981057.796:49): avc:  denied  { dac_override } for  pid=1616 comm="firewalld" capability=1  scontext=system_u:system_r:firewalld_t:s0 tcontext=system_u:system_r:firewalld_t:s0 tclass=capability permissive=0

Comment 2 cshao 2020-02-27 09:30:39 UTC
# imgbase  w 
You are on rhvh-4.4.0.14-0.20200226.0+1
[root@hp-dl385g8-03 ~]# grep "avc:  denied" /var/log/audit/audit.log
type=AVC msg=audit(1582791550.957:34): avc:  denied  { create } for  pid=1820 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0
type=AVC msg=audit(1582791550.957:35): avc:  denied  { create } for  pid=1820 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0
type=AVC msg=audit(1582791551.878:46): avc:  denied  { dac_override } for  pid=1605 comm="firewalld" capability=1  scontext=system_u:system_r:firewalld_t:s0 tcontext=system_u:system_r:firewalld_t:s0 tclass=capability permissive=0

Comment 3 cshao 2020-05-19 03:55:06 UTC
Still can reproduce this issue with the latest RHVH 4.4.

# imgbase  w 
You are on rhvh-4.4.0.21-0.20200518.0+1
[root@hp-bl460cg9-01 ~]# grep "avc:  denied" /var/log/audit/audit.log
type=AVC msg=audit(1589858781.058:35): avc:  denied  { create } for  pid=1948 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0
type=AVC msg=audit(1589858781.058:36): avc:  denied  { create } for  pid=1948 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0
type=AVC msg=audit(1589858781.448:39): avc:  denied  { dac_override } for  pid=1708 comm="firewalld" capability=1  scontext=system_u:system_r:firewalld_t:s0 tcontext=system_u:system_r:firewalld_t:s0 tclass=capability permissive=0

Comment 4 Sandro Bonazzola 2020-06-16 08:00:22 UTC
Gobinda can you please have a look?

Comment 5 Gobinda Das 2020-06-16 09:11:02 UTC
This is looks like there may be some selinux policy missing for gluster rdma.
it looks like a denial for the rdma socket.
If we try to start glusterd using "glusterd" command and systemctl interchangeably then this error seen.
@Sanju Can you please confirm?

Comment 7 Sandro Bonazzola 2020-06-26 15:02:12 UTC
AVC denials doesn't seem to harm functionality, postponing to 4.4.3

Comment 10 Sandro Bonazzola 2020-11-06 15:51:18 UTC
Lev any update on this?

Comment 11 Lev Veyde 2020-12-07 08:18:06 UTC
(In reply to Sandro Bonazzola from comment #10)
> Lev any update on this?

No, not yet.

Comment 12 Lev Veyde 2020-12-07 08:35:05 UTC
On the latest RHVH we get:

type=AVC msg=audit(1606825452.994:32): avc:  denied  { create } for  pid=2240 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0

Comment 13 Lev Veyde 2020-12-07 09:48:00 UTC
Sent a patch to selinux-policy repo: https://github.com/fedora-selinux/selinux-policy/pull/496

Comment 14 Lev Veyde 2020-12-07 10:36:08 UTC
After further debugging while adding more permissions it appears that that we get the following errors:

type=AVC msg=audit(1606825452.994:32): avc:  denied  { create } for  pid=2240 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0
type=AVC msg=audit(1606825452.994:33): avc:  denied  { create } for  pid=2240 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0
type=AVC msg=audit(1607334511.266:32): avc:  denied  { setopt } for  pid=2341 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0
type=AVC msg=audit(1607334511.266:33): avc:  denied  { setopt } for  pid=2341 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0
type=AVC msg=audit(1607336313.918:31): avc:  denied  { bind } for  pid=2379 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0
type=AVC msg=audit(1607336313.919:32): avc:  denied  { bind } for  pid=2379 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0

Thus the full list of the permissions required are:

allow glusterd_t self:netlink_rdma_socket { bind create setopt }

Comment 15 cshao 2020-12-07 12:02:51 UTC
Update:
After clear the audit log on this same machine, and then reboot / un-register to engine, the AVC errors does not re-appear.

So I will verify this bug after got new build which included the fixed patch.

Comment 17 Sandro Bonazzola 2021-03-04 12:47:46 UTC
Lev see comment in your PR "consider cherry-picking to https://github.com/gluster/glusterfs-selinux/"

Comment 18 Sandro Bonazzola 2021-03-04 12:48:26 UTC
Als, Lev, do you know in which rpm your fix will be included?

Comment 19 Lev Veyde 2021-03-09 09:43:10 UTC
(In reply to Sandro Bonazzola from comment #17)
> Lev see comment in your PR "consider cherry-picking to
> https://github.com/gluster/glusterfs-selinux/"

Ported the patch and pushed a PR to glusterfs-selinux repo as well:
https://github.com/gluster/glusterfs-selinux/pull/18

Comment 20 Lev Veyde 2021-03-09 09:46:51 UTC
(In reply to Sandro Bonazzola from comment #18)
> Als, Lev, do you know in which rpm your fix will be included?

I expected the fix to be included in the next release of selinux-policy-targeted, however checking the builds made after the fix was merged it's still not there.
Contacting the selinux-policy package maintainer (that builds the -targeted as well) for clarifications.

Comment 21 Zdenek Pytela 2021-03-16 19:07:04 UTC
If I understand correctly, the fix will be delivered as a part of bz#1937300 so no further selinux-policy backport is needed.

Comment 25 cshao 2021-04-01 09:05:32 UTC
# imgbase w 
You are on rhvh-4.4.5.4-0.20210330.0+1

# grep "avc:  denied" /var/log/audit/audit.log
type=AVC msg=audit(1617263279.650:39): avc:  denied  { create } for  pid=2474 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0
type=AVC msg=audit(1617263279.651:40): avc:  denied  { create } for  pid=2474 comm="glusterd" scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:system_r:glusterd_t:s0 tclass=netlink_rdma_socket permissive=0

Comment 26 Sandro Bonazzola 2021-04-07 09:48:57 UTC
redhat-virtualization-host-4.4.6-20210402.2.el8_4 contains glusterfs-selinux-1.0-3.el8rhgs.noarch

Comment 29 cshao 2021-04-12 08:02:51 UTC
Test version:
rhvh-4.4.6.1-0.20210409.0+1
glusterfs-selinux-1.0-4.el8rhgs.noarch

Test steps:
1. Install RHVH-4.4.6 successful. Selinux in enforcing mode as default.
2. Register to engine.
3. Login to RHVH and run "grep "avc:  denied" /var/log/audit/audit.log".

Test result:
No AVC denied errors in audit.log

So the bug is fixed, change bug status to VERIFIED.

Comment 41 errata-xmlrpc 2021-06-03 10:24:29 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 (Moderate: Red Hat Virtualization Host security update [ovirt-4.4.6]), 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/RHSA-2021:2239


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