-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
base/android/linker: Replace memfd with ASharedMemory
Currently ASharedMemory is backed by ashmem on all Android releases. There is a plan to reimplement it on top of memfd in the future. Using memfd explicitly in Chrome was introduced to apply an R+ workaround allowing to open a file in the App Zygote Preload. Unfortunately this workaround is blocked by SELinux policies. There is an Android change (currently in review) to allow ashmem FDs created by Preload to stay open across fork(2). It will go live not earlier than in S. Here, remove explicit use of memfd_create(2) and replace it with ASharedMemory. With this change The current usage of RELRO regions should be unaffected: RELRO sharing mechanics in linkers is used only in privileged+browser processes. It will start making a difference when the app zygote starts creating RELRO regions. Fly-by cleanups: 1. In *linker_jni.cc refer to the main comment instead of repeating. 2. Make the debug printing consistently use Log.i guarded by DEBUG instead of Log.d - these uses were introduced accidentally. Bug: 1154224 Change-Id: I09effaa27c7f2f0c28f044783e8cad1ebc5c5706 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2960932 Commit-Queue: Egor Pasko <pasko@chromium.org> Reviewed-by: Benoit L <lizeb@chromium.org> Cr-Commit-Position: refs/heads/master@{#892603}
- Loading branch information
Showing
7 changed files
with
57 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.