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.
Description of problem:
setsebool -P changes file mode of /etc/selinux/targeted/active/users_extra from installation value
Version-Release number of selected component (if applicable):
RHEL 7.4
selinux-policy-targeted-3.13.1-166.el7_4.4.noarch
How reproducible:
Consistent
Steps to Reproduce:
1. Install system, note that file mode of /etc/selinux/targeted/active/users_extra is 0600
2. setsebool -P mozilla_plugin_can_network_connect 1
3. New file mode is 0644
Actual results:
File mode changes.
Expected results:
File mode should not change
Additional info:
This will trigger permissions drift and a STIG finding.
It looks like it came with this patch https://github.com/SELinuxProject/selinux/commit/8702a865e08b5660561e194a83e4a363061edc03 which provided some optimization when for setting booleans.
The problem is that it uses for users_extra and seusers default file-mode which is 644. "file-mode" can be changed in /etc/selinux/semanage.conf (file-mode=0600) But it would have a side effect that some of other files would not be readable for users, e.g. matchpathcon would stop work for regular uses.
The patch seems to be just to change from sh->conf->file_mode to 0
--- a/libsemanage/src/direct_api.c
+++ b/libsemanage/src/direct_api.c
@@ -1447,7 +1447,7 @@ rebuild:
retval = semanage_copy_file(path,
semanage_path(SEMANAGE_TMP,
SEMANAGE_STORE_SEUSERS),
- sh->conf->file_mode);
+ 0);
if (retval < 0)
goto cleanup;
pseusers->dtable->drop_cache(pseusers->dbase);
@@ -1460,7 +1460,7 @@ rebuild:
retval = semanage_copy_file(path,
semanage_path(SEMANAGE_TMP,
SEMANAGE_USERS_EXTRA),
- sh->conf->file_mode);
+ 0);
if (retval < 0)
goto cleanup;
pusers_extra->dtable->drop_cache(pusers_extra->dbase);
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, 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-2018:3088