This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2231023 - setroubleshoot dies when an incompatible selinux python module exists in /usr/local/lib
Summary: setroubleshoot dies when an incompatible selinux python module exists in /usr...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: setroubleshoot
Version: 8.8
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Vit Mojzis
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-10 11:33 UTC by Renaud Métrich
Modified: 2023-09-19 20:22 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-19 20:21:07 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   RHEL-5201 0 None Migrated None 2023-09-19 20:21:06 UTC
Red Hat Issue Tracker RHELPLAN-165487 0 None None None 2023-08-10 11:35:30 UTC

Description Renaud Métrich 2023-08-10 11:33:41 UTC
Description of problem:

All platform-python scripts should be protected from using custom paths such as /usr/local/lib/python3.6, or else failure may happen when 3rd party python modules are present in such directory.

We have a customer hitting this issue due to having his own  /usr/local/lib/python3.6/site-packages/selinux module taking precedence other our module (/usr/lib64/python3.6/site-packages/selinux).

In order to avoid the issue, /usr/share/setroubleshoot/SetroubleshootPrivileged.py shebang has to be modified as shown below:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
#!/usr/libexec/platform-python -Es
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

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

setroubleshoot-server-3.3.26-5.el8.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Create a rogue selinux module

  -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
  # mkdir -p /usr/local/lib/python3.6/site-packages/selinux
  # echo "BUG" > /usr/local/lib/python3.6/site-packages/selinux/__init__.py
  -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

2. Trigger an AVC or use the following python inline script to illustrate what would happen

  -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
  # /usr/libexec/platform-python
  [...]
  >>> import selinux
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python3.6/site-packages/selinux/__init__.py", line 1, in <module>
      BUG
  NameError: name 'BUG' is not defined
  -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Actual results:

  Faulty /usr/local/lib/python3.6/site-packages/selinux loaded instead of /usr/lib64/python3.6/site-packages/selinux

Expected results:

  /usr/lib64/python3.6/site-packages/selinux being loaded, as seen with "/usr/libexec/platform-python -Es":

  -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
  # /usr/libexec/platform-python -Es
  [...]
  >>> import selinux
  >>> 
  -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Comment 2 RHEL Program Management 2023-09-19 17:51:53 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.


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