Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executable Memory-Mapped Files on Android are Unsupported in non-Root Scenarios #3

Open
Sewer56 opened this issue Sep 9, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Sewer56
Copy link
Member

Sewer56 commented Sep 9, 2023

On Android, it appears that creating a memory-mapped file with 'execute' permissions in a location accessible by multiple processes is not possible (without root). The Android platform seems to enforce strict W^X (Write XOR Execute) policies, which prevent memory from being simultaneously writable and executable in shared memory locations.

There's also another issue. To utilize common shared storage in Android, the requisite permissions must be set in AndroidManifest.xml.

However, despite setting the appropriate permissions, creating a RWX memory mapped file on Android does not seem to work regardless. It may be possible if you memory map the file twice (non-writeable for executing, and writeable for writing, but I have not yet tested).

Current Behaviour

Currently on Android, library will not be able to detect existing LocatorHeader(s) created by other instances of the library in the same process. A new LocatorHeader will always be created.

@Sewer56 Sewer56 added the bug Something isn't working label Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant