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 2019962 - "seinfo --constrain" doesn't produce identical output when constraints haven't changed
Summary: "seinfo --constrain" doesn't produce identical output when constraints haven'...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: setools
Version: 9.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Petr Lautrbach
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-03 17:37 UTC by Jan Stodola
Modified: 2022-05-17 16:29 UTC (History)
5 users (show)

Fixed In Version: setools-4.4.0-4.el9
Doc Type: No Doc Update
Doc Text:
Clone Of: 2019961
Environment:
Last Closed: 2022-05-17 15:58:06 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SELinuxProject setools issues 65 0 None open Output of `seinfo -c -x` and others is not predictable 2021-11-04 14:58:01 UTC
Red Hat Issue Tracker RHELPLAN-101671 0 None None None 2021-11-03 17:38:20 UTC
Red Hat Product Errata RHBA-2022:3982 0 None None None 2022-05-17 15:58:07 UTC

Description Jan Stodola 2021-11-03 17:37:22 UTC
The same problem on RHEL-9 with setools-console-4.4.0-3.el9:

+++ This bug was initially created as a clone of Bug #2019961 +++

Description of problem:
"seinfo --constrain" doesn't produce the same output when the command is executed multiple times:

# seinfo --constrain > 1
# seinfo --constrain > 2
# diff -q 1 2
Files 1 and 2 differ
# rpm -qf $(which seinfo)
setools-console-4.3.0-2.el8.x86_64
#

Since the output is different every time, it's not easily usable for searching for differences in SELinux policies.

Version-Release number of selected component (if applicable):
setools-console-4.3.0-2.el8

How reproducible:
Always

Steps to Reproduce:
1. run "seinfo --constrain" several time and compare the outputs

Actual results:
Outputs differ.

Expected results:
Outputs are the same every time (unless the constraints really change).

Comment 1 Milos Malik 2021-11-03 18:21:49 UTC
It looks like permissions are not sorted in the seinfo output:

# seinfo --constrain | sort > 1.txt
# seinfo --constrain | sort > 2.txt
# diff 1.txt 2.txt | grep alg_socket
<    constrain alg_socket { relabelto create relabelfrom } (u1 == u2 or ( t1 == can_change_object_identity )); 
>    constrain alg_socket { relabelfrom create relabelto } (u1 == u2 or ( t1 == can_change_object_identity )); 
#

Comment 2 Petr Lautrbach 2021-11-18 16:46:40 UTC
https://github.com/SELinuxProject/setools/pull/66 is accepted and merged upstream.

Comment 11 errata-xmlrpc 2022-05-17 15:58:06 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 (new packages: setools), 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-2022:3982


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