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 2148561 - SELinux is preventing /usr/bin/ipmitool from ioctl access on the chr_file /dev/ipmi0.
Summary: SELinux is preventing /usr/bin/ipmitool from ioctl access on the chr_file /de...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.7
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 8.8
Assignee: Zdenek Pytela
QA Contact: Milos Malik
Jan Fiala
URL:
Whiteboard:
Depends On:
Blocks: 2158419
TreeView+ depends on / blocked
 
Reported: 2022-11-25 22:48 UTC by cweather
Modified: 2023-05-16 11:02 UTC (History)
6 users (show)

Fixed In Version: selinux-policy-3.14.3-114.el8
Doc Type: Bug Fix
Doc Text:
.The SELinux policy now allows confined administrators to access `ipmi` devices when IPMItool runs Previously, the SELinux policy did not allow confined administrators to read and write `ipmi` devices when the IPMItool utility is run. As a consequence, when a confined administrator ran `ipmitool`, it failed. This update adds allow rules to `selinux-policy` for administrators assigned to the `sysadm_r` SELinux role. As a result, if a confined administrator runs `ipmitool` it works correctly.
Clone Of:
: 2158419 (view as bug list)
Environment:
Last Closed: 2023-05-16 09:04:19 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1486 0 None open Allow sysadm read ipmi devices 2022-11-28 15:19:58 UTC
Github fedora-selinux selinux-policy pull 1547 0 None open Allow sysadm_t read/write ipmi devices 2023-01-04 16:38:36 UTC
Red Hat Issue Tracker RHELPLAN-140537 0 None None None 2022-11-25 22:51:10 UTC
Red Hat Product Errata RHBA-2023:2965 0 None None None 2023-05-16 09:04:37 UTC

Description cweather 2022-11-25 22:48:00 UTC
Description of problem:
SELinux is preventing /usr/bin/ipmitool from ioctl access on the chr_file /dev/ipmi0.

Version-Release number of selected component (if applicable):
selinux-policy-3.14.3-108.el8.noarch                        Wed Nov  9 11:19:25 2022
ipmitool-1.8.18-18.el8.x86_64                               Wed Nov 23 07:55:32 2022
Linux cauchy.sd.spawar.navy.mil 4.18.0-425.3.1.el8.x86_64 

How reproducible:
Always

Steps to Reproduce:
1.  Use ipmitool
2.  Recent version of selinux policy
3.  SELinux enabled

Actual results:
Receive AVC denials in /var/log/messages

Expected results:
No AVC denials

Additional info:
The default SELinux policy does not provide the necessary permissions for admins operating under the sysadm_t label to use ipmitool. 

Missing permission appear to be open, read, write, and ioctl on chr_file class with the ipmi_device_t label.

Context: system_u:object_r:ipmi_device_t:s0 /dev/ipmi0

Comment 1 Zdenek Pytela 2022-11-28 16:04:25 UTC
Commit to backport:
commit d74ec4955e90e4938da7a197438ff5db9704df19 (HEAD -> rawhide, upstream/rawhide)
Author: Zdenek Pytela <zpytela>
Date:   Mon Nov 28 16:16:06 2022 +0100

    Allow sysadm read ipmi devices

Comment 9 Zdenek Pytela 2023-01-12 10:17:13 UTC
To backport:
commit 650edec42cc5d5bf7d8562eddbadb0efc6f42a24
Author: Zdenek Pytela <zpytela>
Date:   Wed Jan 4 17:36:09 2023 +0100

    Allow sysadm_t read/write ipmi devices

Comment 23 errata-xmlrpc 2023-05-16 09:04:19 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-2023:2965


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