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.
DescriptionJaroslav Škarvada
2019-06-21 08:09:13 UTC
Created attachment 1583048[details]
Proposed fix
Description of problem:
libffi code searches for the tmpdir with exec to write and execute their temporal files from there. On hardened systems with most of the mounts mounted with noexec, it can fell through the explicit list of candidate dirs to the mtab search and then it can take the root directory ('/') which will result in SELinux AVCs. As most of the systems have /run mounted with exec, it could be worth adding it to the explicit list of candidates. Well, it will not solve the problem for everybody, because FHS doesn't say anything about exec/noexec of the /run, so customers could remount it noexec, but it would be definitely improvement.
Version-Release number of selected component (if applicable):
libffi-3.0.13-18.el7.x86_64
How reproducible:
Always
Steps to Reproduce:
1. check the code
2.
3.
Actual results:
/run is not in the explicit search list
Expected results:
/run could be in the explicit search list
Additional info:
I think the way forward here is to switch to a trampoline which does not need run-time code generation, only mapping of fixed, pre-compiled code. Then all that dual-mapping and cache-flushing code can go away.
As we have not gotten any feedback or solutions from upstream, we are unable to fix this bug in the RHEL 7 timeframe, as RHEL 7 is entering maintenance phase. We will continue to track this request in RHEL 8.
Created attachment 1583048 [details] Proposed fix Description of problem: libffi code searches for the tmpdir with exec to write and execute their temporal files from there. On hardened systems with most of the mounts mounted with noexec, it can fell through the explicit list of candidate dirs to the mtab search and then it can take the root directory ('/') which will result in SELinux AVCs. As most of the systems have /run mounted with exec, it could be worth adding it to the explicit list of candidates. Well, it will not solve the problem for everybody, because FHS doesn't say anything about exec/noexec of the /run, so customers could remount it noexec, but it would be definitely improvement. Version-Release number of selected component (if applicable): libffi-3.0.13-18.el7.x86_64 How reproducible: Always Steps to Reproduce: 1. check the code 2. 3. Actual results: /run is not in the explicit search list Expected results: /run could be in the explicit search list Additional info: