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 1295680 - [SELinux] Occasionally observing AVC's denied while running geo-rep automation
Summary: [SELinux] Occasionally observing AVC's denied while running geo-rep automation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.2
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: 1372182
TreeView+ depends on / blocked
 
Reported: 2016-01-05 08:39 UTC by Rahul Hinduja
Modified: 2016-11-04 02:39 UTC (History)
12 users (show)

Fixed In Version: selinux-policy-3.13.1-71.el7
Doc Type: Bug Fix
Doc Text:
Previously, AVC denials messages were observed while running Red Hat Gluster Storage (RHGS) Geo-replication. The "dontaudit" rules for the Geo-replication has been added, and the AVC denials messages no longer appear.
Clone Of:
: 1372182 (view as bug list)
Environment:
Last Closed: 2016-11-04 02:39:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2283 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2016-11-03 13:36:25 UTC

Description Rahul Hinduja 2016-01-05 08:39:48 UTC
Description of problem:
=======================

Upon completion of geo-replication gluster storage run, observed following AVC's:

type=AVC msg=audit(1451965501.485:873): avc:  denied  { getattr } for  pid=28188 comm="ps" path="/dev/tty1" dev="devtmpfs" ino=1043 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tty_device_t:s0 tclass=chr_file
type=AVC msg=audit(1451965501.485:874): avc:  denied  { getattr } for  pid=28188 comm="ps" path="/dev/tty1" dev="devtmpfs" ino=1043 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tty_device_t:s0 tclass=chr_file
type=AVC msg=audit(1451965501.485:875): avc:  denied  { getattr } for  pid=28188 comm="ps" path="/dev/tty1" dev="devtmpfs" ino=1043 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tty_device_t:s0 tclass=chr_file

Though the automation runs are passed and no functionality loss has been observed. 

[root@dhcp46-96 ~]# ls -Z /dev/tty1
crw--w----. root tty system_u:object_r:tty_device_t:s0 /dev/tty1
[root@dhcp46-96 ~]# 


Version-Release number of selected component (if applicable):
=============================================================

[root@dhcp46-96 ~]# rpm -qa | grep selinux-policy
selinux-policy-targeted-3.13.1-60.el7.noarch
selinux-policy-3.13.1-60.el7.noarch
[root@dhcp46-96 ~]# 


Gluster Version:
================

glusterfs-3.7.5-13.el7rhgs.x86_64


How reproducible:
=================

Ran the same automation more than 5 times and observed this twice. Tried running the same scripts manually and didn't observe these AVC's.

Comment 2 Milos Malik 2016-01-05 10:12:29 UTC
Does your scenario produce other AVCs in permissive mode?

Comment 3 Rahul Hinduja 2016-01-07 11:06:21 UTC
Tried the same scenario's couple of times in permissive mode. The only AVC observed are: 

[root@localhost scripts]# grep -i "avc" /var/log/audit/audit.log 
type=USER_AVC msg=audit(1452083477.867:38800): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  received policyload notice (seqno=46)  exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'
type=USER_AVC msg=audit(1452148794.569:40973): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  received policyload notice (seqno=47)  exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'
[root@localhost scripts]# 

[root@localhost scripts]# getenforce 
Permissive
[root@localhost scripts]# 


As mentioned in the description, the avc related to getattr for comm="ps" and path="/dev/tty1" were only observed twice in multiple tries of automation run. 

I will keep checking for avc in my regression run and will update if happened to see them again.

Comment 4 Miroslav Grepl 2016-01-11 08:42:22 UTC
Did your tests work correctly?

Comment 5 Rahul Hinduja 2016-02-10 15:11:52 UTC
(In reply to Miroslav Grepl from comment #4)
> Did your tests work correctly?

Hi Miroslav,

Since last month the same cases were run multiple times {4+} but only observed this issue with todays run as:

[root@dhcp37-206 ~]# grep -i "avc" /var/log/audit/audit.log 
type=USER_AVC msg=audit(1455088627.000:95342): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  received policyload notice (seqno=17)  exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'
type=AVC msg=audit(1455089581.718:95479): avc:  denied  { getattr } for  pid=28794 comm="ps" path="/dev/tty1" dev="devtmpfs" ino=1043 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tty_device_t:s0 tclass=chr_file
type=AVC msg=audit(1455089581.718:95480): avc:  denied  { getattr } for  pid=28794 comm="ps" path="/dev/tty1" dev="devtmpfs" ino=1043 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tty_device_t:s0 tclass=chr_file
type=AVC msg=audit(1455089581.718:95481): avc:  denied  { getattr } for  pid=28794 comm="ps" path="/dev/tty1" dev="devtmpfs" ino=1043 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tty_device_t:s0 tclass=chr_file
[root@dhcp37-206 ~]# 
[root@dhcp37-206 ~]# 
[root@dhcp37-206 ~]#  rpm -qa | grep selinux-policy 
selinux-policy-3.13.1-60.el7_2.3.noarch
selinux-policy-targeted-3.13.1-60.el7_2.3.noarch
[root@dhcp37-206 ~]# 
[root@dhcp37-206 ~]# getenforce 
Enforcing
[root@dhcp37-206 ~]# 

All my 34 tests are passed.

Comment 6 Rahul Hinduja 2016-02-12 11:18:25 UTC
Another AVC's observed for the 2nd time in multiple runs of automation. This avc is observed on 2 node from 6 node cluster. 

[root@dhcp37-177 scripts]# grep -i "avc" /var/log/audit/audit.log 
type=USER_AVC msg=audit(1455194761.044:841): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  received policyload notice (seqno=2)  exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'
type=AVC msg=audit(1455198364.732:1356): avc:  denied  { read } for  pid=16732 comm="ldconfig" path="/var/lib/glusterd/geo-replication/master_10.70.37.52_slave" dev="dm-0" ino=149858 scontext=system_u:system_r:ldconfig_t:s0 tcontext=system_u:object_r:glusterd_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1455198364.737:1357): avc:  denied  { read } for  pid=16734 comm="ldconfig" path="/var/lib/glusterd/geo-replication/master_10.70.37.52_slave" dev="dm-0" ino=149858 scontext=system_u:system_r:ldconfig_t:s0 tcontext=system_u:object_r:glusterd_var_lib_t:s0 tclass=dir

Systems are cleaned as part of cleanup:

[root@dhcp37-177 glusterfs]# cat /var/log/audit/audit.log | audit2allow 


#============= ldconfig_t ==============
allow ldconfig_t glusterd_var_lib_t:dir read;
[root@dhcp37-177 glusterfs]# 

None of the automation cases failed and all files synced to slave. And all the files are accessible from client.

Comment 20 errata-xmlrpc 2016-11-04 02:39:33 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.

https://rhn.redhat.com/errata/RHBA-2016-2283.html


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