Hide Forgot
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:
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.
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/
Let's move the discussion to one place. *** This bug has been marked as a duplicate of bug 1392573 ***