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 1392154 - semodule -l lost policy versioning listing
Summary: semodule -l lost policy versioning listing
Keywords:
Status: CLOSED DUPLICATE of bug 1392573
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: policycoreutils
Version: 7.3
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Petr Lautrbach
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 1391886
TreeView+ depends on / blocked
 
Reported: 2016-11-05 11:38 UTC by Andrea Veri
Modified: 2020-02-14 18:06 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-11 09:39:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1391886 0 unspecified CLOSED Puppet's selmodule syncversion is called at each run even when the policy version has been loaded already 2021-02-22 00:41:40 UTC
Red Hat Knowledge Base (Solution) 2760071 0 None None None 2016-11-10 08:55:43 UTC

Description Andrea Veri 2016-11-05 11:38:28 UTC
Description of problem:

semodule -l is not showing up policy modules versions anymore as it was used to do since the time I recall about using the semodule command:

With RHEL 7.3 this fails:

semodule -l | head -n 5
abrt
accountsd
acct
afs
aiccu

With RHEL 6 or RHEL 7.2 it works as expected:

semodule -l | head -n 5
abrt	1.2.0	
accountsd	1.0.0	
ada	1.4.0	
afs	1.5.3	
aiccu	1.0.0

Version-Release number of selected component (if applicable):
policycoreutils-2.5-8.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Run semodule -l

Actual results:

semodule -l | head -n 5
abrt
accountsd
acct
afs
aiccu

Expected results:

semodule -l | head -n 5
abrt	1.2.0	
accountsd	1.0.0	
ada	1.4.0	
afs	1.5.3	
aiccu	1.0.0

Additional info:

Comment 2 Christian Kaenzig 2016-11-08 07:52:05 UTC
Hello, this bug also affects RHEL 7.2 when the policycoreutils package is upgraded to 2.5-8.

I opened as support case with Red Hat, here is the answer I got:

---
The new SELinux userspace uses SELinux Common Intermediate Language (CIL) in the module store. CIL treats files as modules and does not have a separate module statement, the module is named after the file name. 

Unfortunately CIL doesn't support policy_module() statement. It means that modules don't have versions anymore. Now we have namespaces for policy rules. So all the current rules are in the global namespace and we don't identify them using policy modules as before.
---

I don't currently understand what this means exactly as I lack knowledge about how selinux modules work exactly.

Comment 4 Petr Lautrbach 2016-11-10 22:41:12 UTC
SELinux userspace 2.4 and higher uses CIL and CIL doesn't have any component which would represent a module name or version. Therefore a module name is derived from a filename and a version completely dropped from semodule output.

However, original .pp files are stored together with cil files as hll files. It means that a version could be extracted from that file.

I prepared a patch and srpms [1] with libsemanage patched to look to try to extract a version from hll files if an original module was installed from .pp file. And semodule patched to accept another list option - legacy - which tries to provide same output as pre-2.4 releases, e.g.:

# semodule -l | tail -n 3    
zarafa
zebra
zoneminder

# semodule -lfull | tail -n 3
100 zebra             pp         
100 zoneminder        cil         
100 zosremote         pp disabled

# semodule -llegacy | tail -n 3
zebra   1.13.0
zoneminder      (null)
zosremote       1.2.0   Disabled



(null) at zoneminder means that the module was not installed from .pp file and there's no version available.


[1] https://plautrba.fedorapeople.org/copr/selinux-semodule-llegacy/

Comment 6 Petr Lautrbach 2016-11-11 09:39:35 UTC
Let's move the discussion to one place.

*** This bug has been marked as a duplicate of bug 1392573 ***


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