Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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

Summary: "seinfo --constrain" doesn't produce identical output when constraints haven't changed
Product: Red Hat Enterprise Linux 9 Reporter: Jan Stodola <jstodola>
Component: setoolsAssignee: Petr Lautrbach <plautrba>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.0CC: lvrabec, mmalik, plautrba, qe-baseos-security, vmojzis
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: setools-4.4.0-4.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 2019961 Environment:
Last Closed: 2022-05-17 15:58:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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