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.

Bug 1722756

Summary: libffi: Try the /run directory when searching for the exec tmpdir on hardened systems
Product: Red Hat Enterprise Linux 7 Reporter: Jaroslav Škarvada <jskarvad>
Component: libffiAssignee: DJ Delorie <dj>
Status: CLOSED WONTFIX QA Contact: qe-baseos-tools-bugs
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: bgollahe, codonell, dj, fkrska, fweimer
Target Milestone: pre-dev-freezeKeywords: FutureFeature, Patch
Target Release: 7.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1723951 (view as bug list) Environment:
Last Closed: 2019-08-06 16:11:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1710258, 1723951    
Attachments:
Description Flags
Proposed fix none

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.