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 1551568 - Cannot execute mdadm when policy is MLS
Summary: Cannot execute mdadm when policy is MLS
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.6
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: 1551569
TreeView+ depends on / blocked
 
Reported: 2018-03-05 12:30 UTC by Renaud Métrich
Modified: 2021-06-10 15:03 UTC (History)
5 users (show)

Fixed In Version: selinux-policy-3.13.1-197.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1551569 (view as bug list)
Environment:
Last Closed: 2018-10-30 10:03:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3111 0 None None None 2018-10-30 10:03:47 UTC

Description Renaud Métrich 2018-03-05 12:30:23 UTC
Description of problem:

Upon switching to MLS policy, the sysadm_r user (e.g. root) cannot execute mdadm, getting the following error:

type=SYSCALL msg=audit(): arch=c000003e syscall=59 success=no exit=-13 a0=1fff930 a1=1ffbee0 a2=2006110 a3=7ffd72116750 items=0 ppid=2877 pid=2893 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=tty2 ses=2 comm="bash" exe="/bin/bash" subj=root:sysadm_r:sysadm_t:s0-s15:c0.c1023 key=(null)
type=SELINUX_ERR msg=audit(): op=security_compute_sid invalid_context=root:sysadm_r:mdadm_t:s0-s15:c0.c1023 scontext=root:sysadm_r:sysadm_t:s0-s15:c0.c1023 tcontext=system_u:object_r:mdadm_exec_t:s0 tclass=process

lvrabec++ found root cause, fixed in Fedora: https://github.com/fedora-selinux/selinux-policy/commit/579d1bc8124a2a908d071105458a6f0f4f60e423


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

selinux-policy-mls-3.13.1-166.el7_4.7.noarch


How reproducible:

Always


Steps to Reproduce:
1. Execute "mdadm" as root user while in MLS enforcing

Actual results:

-bash: /usr/sbin/mdadm: Permission denied


Expected results:

Works

Comment 3 Milos Malik 2018-09-17 16:09:44 UTC
# id -Z
root:sysadm_r:sysadm_t:s0
# sestatus 
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             mls
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     denied
Max kernel policy version:      31
# mdadm /dev/vda
/dev/vda: is not an md array
# mdadm
Usage: mdadm --help
  for help
# 

Unfortunately, if the daemons_use_tty boolean is disabled, then mdadm is completely silent:

# setsebool daemons_use_tty off
# mdadm 
# mdadm --help
# mdadm /dev/vda
# 

Either the need to use the boolean is documented or policy needs to be improved.

# rpm -qa selinux\*
selinux-policy-sandbox-3.13.1-226.el7.noarch
selinux-policy-targeted-3.13.1-226.el7.noarch
selinux-policy-doc-3.13.1-226.el7.noarch
selinux-policy-mls-3.13.1-226.el7.noarch
selinux-policy-3.13.1-226.el7.noarch
selinux-policy-devel-3.13.1-226.el7.noarch
#

Comment 5 errata-xmlrpc 2018-10-30 10:03:08 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://access.redhat.com/errata/RHBA-2018:3111


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