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 1722756 - libffi: Try the /run directory when searching for the exec tmpdir on hardened systems
Summary: libffi: Try the /run directory when searching for the exec tmpdir on hardened...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libffi
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: pre-dev-freeze
: 7.8
Assignee: DJ Delorie
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: 1710258 1723951
TreeView+ depends on / blocked
 
Reported: 2019-06-21 08:09 UTC by Jaroslav Škarvada
Modified: 2024-03-25 15:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1723951 (view as bug list)
Environment:
Last Closed: 2019-08-06 16:11:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed fix (442 bytes, patch)
2019-06-21 08:09 UTC, Jaroslav Škarvada
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1667620 0 unspecified CLOSED Limit mounts that libffi will try to write to 2021-11-30 16:13:50 UTC
Red Hat Knowledge Base (Solution) 4253591 0 Troubleshoot None firewalld triggers SELinux AVCs if /tmp, /var/tmp, and /dev/shm are mounted with noexec 2019-06-28 08:24:20 UTC

Description Jaroslav Š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:

Comment 4 Florian Weimer 2019-06-21 09:28:23 UTC
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.

Comment 5 Carlos O'Donell 2019-06-25 16:00:03 UTC
In RHEL7 we should just add the extra search directory and stop there, but in later releases we may have the opportunity to rework libffi.

Comment 7 DJ Delorie 2019-08-06 16:11:49 UTC
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.


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