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 2073386 - SELinux is preventing wsrep_sst_rsync getattr of /usr/bin/hostname
Summary: SELinux is preventing wsrep_sst_rsync getattr of /usr/bin/hostname
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: mysql-selinux
Version: 9.0
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Michal Schorm
QA Contact: Jakub Heger
URL:
Whiteboard:
: 2089664 (view as bug list)
Depends On:
Blocks: 2089180 2096271
TreeView+ depends on / blocked
 
Reported: 2022-04-08 11:34 UTC by Jakub Heger
Modified: 2022-12-30 11:21 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2089180 2096271 (view as bug list)
Environment:
Last Closed: 2022-10-19 13:39:05 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-118372 0 None None None 2022-10-19 11:45:15 UTC
Red Hat Knowledge Base (Solution) 6961607 0 None None None 2022-06-02 10:18:32 UTC

Description Jakub Heger 2022-04-08 11:34:44 UTC
Description of problem:
See avc.log [1] from beaker job [2].

Version-Release number of selected component (if applicable):
selinux-policy-34.1.29-1.el9_0.noarch

How reproducible:
always

Steps to Reproduce:
1. Run /CoreOS/mariadb/Multihost/Galera-basic-setup 
2.
3.

Actual results:
<snip>
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      33
selinux-policy-34.1.29-1.el9_0.noarch
----
time->Thu Apr  7 03:43:56 2022
type=PROCTITLE msg=audit(1649317436.179:381): proctitle=2F7573722F62696E2F62617368002D7565002F7573722F2F62696E2F77737265705F7373745F7273796E63002D2D726F6C65006A6F696E6572002D2D616464726573730031302E302E3136302E3535002D2D64617461646972002F7661722F6C69622F6D7973716C2F002D2D706172656E74003238373734002D2D6D7973716C
type=PATH msg=audit(1649317436.179:381): item=0 name="/usr//bin/hostname" inode=134357841 dev=fd:00 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:hostname_exec_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=CWD msg=audit(1649317436.179:381): cwd="/var/lib/mysql"
type=SYSCALL msg=audit(1649317436.179:381): arch=80000016 syscall=293 success=no exit=-13 a0=ffffffffffffff9c a1=2aa2130af50 a2=3ffc0afa990 a3=0 items=1 ppid=28783 pid=28870 auid=4294967295 uid=27 gid=27 euid=27 suid=27 fsuid=27 egid=27 sgid=27 fsgid=27 tty=(none) ses=4294967295 comm="wsrep_sst_rsync" exe="/usr/bin/bash" subj=system_u:system_r:mysqld_t:s0 key=(null)
type=AVC msg=audit(1649317436.179:381): avc:  denied  { getattr } for  pid=28870 comm="wsrep_sst_rsync" path="/usr/bin/hostname" dev="dm-0" ino=134357841 scontext=system_u:system_r:mysqld_t:s0 tcontext=system_u:object_r:hostname_exec_t:s0 tclass=file permissive=0
</snip>

Expected results:
No AVC denials.

Additional info:
[1] https://beaker-archive.host.prod.eng.bos.redhat.com/beaker-logs/2022/04/64784/6478420/11749573/142376733/664901856/avc.log
[2] https://beaker.engineering.redhat.com/recipes/11749573#task142376733

Comment 1 Milos Malik 2022-04-11 08:31:51 UTC
The SELinux denials recorded in the attached logs appeared in the enforcing mode.

To analyze and fix the problem properly, we need to know what kind of SELinux denials appear in permissive mode.

Please run the automated test in permissive mode, collect SELinux denials and attach them here.

Thank you.

Comment 2 Jakub Heger 2022-04-11 09:47:39 UTC
----
type=PROCTITLE msg=audit(04/11/2022 05:40:39.149:300) : proctitle=/usr/bin/bash -ue /usr//bin/wsrep_sst_rsync --role joiner --address 10.0.139.106 --datadir /var/lib/mysql/ --parent 4959 --mysql 
type=SYSCALL msg=audit(04/11/2022 05:40:39.149:300) : arch=x86_64 syscall=newfstatat success=yes exit=0 a0=AT_FDCWD a1=0x55caee8708b0 a2=0x7ffc1704f5a0 a3=0x0 items=0 ppid=4968 pid=5055 auid=unset uid=mysql gid=mysql euid=mysql suid=mysql fsuid=mysql egid=mysql sgid=mysql fsgid=mysql tty=(none) ses=unset comm=wsrep_sst_rsync exe=/usr/bin/bash subj=system_u:system_r:mysqld_t:s0 key=(null) 
type=AVC msg=audit(04/11/2022 05:40:39.149:300) : avc:  denied  { getattr } for  pid=5055 comm=wsrep_sst_rsync path=/usr/bin/hostname dev="vda1" ino=4458075 scontext=system_u:system_r:mysqld_t:s0 tcontext=system_u:object_r:hostname_exec_t:s0 tclass=file permissive=1 
----
type=PROCTITLE msg=audit(04/11/2022 05:40:39.149:301) : proctitle=/usr/bin/bash -ue /usr//bin/wsrep_sst_rsync --role joiner --address 10.0.139.106 --datadir /var/lib/mysql/ --parent 4959 --mysql 
type=SYSCALL msg=audit(04/11/2022 05:40:39.149:301) : arch=x86_64 syscall=access success=yes exit=0 a0=0x55caee8708b0 a1=X_OK a2=0x7ffc1704f4c0 a3=0x0 items=0 ppid=4968 pid=5055 auid=unset uid=mysql gid=mysql euid=mysql suid=mysql fsuid=mysql egid=mysql sgid=mysql fsgid=mysql tty=(none) ses=unset comm=wsrep_sst_rsync exe=/usr/bin/bash subj=system_u:system_r:mysqld_t:s0 key=(null) 
type=AVC msg=audit(04/11/2022 05:40:39.149:301) : avc:  denied  { execute } for  pid=5055 comm=wsrep_sst_rsync name=hostname dev="vda1" ino=4458075 scontext=system_u:system_r:mysqld_t:s0 tcontext=system_u:object_r:hostname_exec_t:s0 tclass=file permissive=1 
----
type=PROCTITLE msg=audit(04/11/2022 05:40:39.149:302) : proctitle=/usr/bin/bash -ue /usr//bin/wsrep_sst_rsync --role joiner --address 10.0.139.106 --datadir /var/lib/mysql/ --parent 4959 --mysql 
type=SYSCALL msg=audit(04/11/2022 05:40:39.149:302) : arch=x86_64 syscall=access success=yes exit=0 a0=0x55caee8708b0 a1=R_OK a2=0x7ffc1704f4c0 a3=0x0 items=0 ppid=4968 pid=5055 auid=unset uid=mysql gid=mysql euid=mysql suid=mysql fsuid=mysql egid=mysql sgid=mysql fsgid=mysql tty=(none) ses=unset comm=wsrep_sst_rsync exe=/usr/bin/bash subj=system_u:system_r:mysqld_t:s0 key=(null) 
type=AVC msg=audit(04/11/2022 05:40:39.149:302) : avc:  denied  { read } for  pid=5055 comm=wsrep_sst_rsync name=hostname dev="vda1" ino=4458075 scontext=system_u:system_r:mysqld_t:s0 tcontext=system_u:object_r:hostname_exec_t:s0 tclass=file permissive=1 
----
type=PROCTITLE msg=audit(04/11/2022 05:40:39.149:303) : proctitle=/usr/bin/bash -ue /usr//bin/wsrep_sst_rsync --role joiner --address 10.0.139.106 --datadir /var/lib/mysql/ --parent 4959 --mysql 
type=PATH msg=audit(04/11/2022 05:40:39.149:303) : item=0 name=/lib64/ld-linux-x86-64.so.2 inode=6382671 dev=fd:01 mode=file,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:ld_so_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 
type=CWD msg=audit(04/11/2022 05:40:39.149:303) : cwd=/var/lib/mysql 
type=EXECVE msg=audit(04/11/2022 05:40:39.149:303) : argc=2 a0=hostname a1=-s 
type=SYSCALL msg=audit(04/11/2022 05:40:39.149:303) : arch=x86_64 syscall=execve success=yes exit=0 a0=0x55caee8708b0 a1=0x55caee876310 a2=0x55caee870960 a3=0x55caee876670 items=1 ppid=4968 pid=5055 auid=unset uid=mysql gid=mysql euid=mysql suid=mysql fsuid=mysql egid=mysql sgid=mysql fsgid=mysql tty=(none) ses=unset comm=hostname exe=/usr/bin/hostname subj=system_u:system_r:mysqld_t:s0 key=(null) 
type=AVC msg=audit(04/11/2022 05:40:39.149:303) : avc:  denied  { map } for  pid=5055 comm=hostname path=/usr/bin/hostname dev="vda1" ino=4458075 scontext=system_u:system_r:mysqld_t:s0 tcontext=system_u:object_r:hostname_exec_t:s0 tclass=file permissive=1 
type=AVC msg=audit(04/11/2022 05:40:39.149:303) : avc:  denied  { execute_no_trans } for  pid=5055 comm=wsrep_sst_rsync path=/usr/bin/hostname dev="vda1" ino=4458075 scontext=system_u:system_r:mysqld_t:s0 tcontext=system_u:object_r:hostname_exec_t:s0 tclass=file permissive=1 
type=AVC msg=audit(04/11/2022 05:40:39.149:303) : avc:  denied  { open } for  pid=5055 comm=wsrep_sst_rsync path=/usr/bin/hostname dev="vda1" ino=4458075 scontext=system_u:system_r:mysqld_t:s0 tcontext=system_u:object_r:hostname_exec_t:s0 tclass=file permissive=1 


Is this what you are looking for?

Comment 3 Milos Malik 2022-04-11 10:37:08 UTC
Yes, thank you.

Comment 7 Michal Schorm 2022-06-09 09:48:40 UTC
Upstream PR:
  https://github.com/devexp-db/mysql-selinux/pull/2/files

Comment 8 Michal Schorm 2022-06-09 11:36:46 UTC
CentOS Stream 9 MR:
  https://gitlab.com/redhat/centos-stream/rpms/mysql-selinux/-/merge_requests/2

Comment 9 Michal Schorm 2022-06-09 11:43:01 UTC
C9S MR merged

Comment 10 Michal Schorm 2022-06-09 12:39:50 UTC
*** Bug 2089664 has been marked as a duplicate of this bug. ***


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