Skip to content

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

@Sewer56

Description

@Sewer56

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions