Compare how different Android ROM configurations respond to deliberate memory misuse at the allocator level. The goal is to determine whether each allocator detects and aborts on violations (double-free, use-after-free, heap overflow) or allows them to pass silently.
GrapheneOS with hardened_malloc is used as the strict reference. For each test, the expected hardened_malloc behavior (signal, abort message) is embedded in the test output and serves as the detection benchmark.
The native test library (libmemtests.so) wraps C test cases derived from the hardened_malloc
reference test suite. Tests are exposed via JNI and triggered individually from the app UI.
Categories:
- double_free — free the same allocation twice; small and large variants with optional delay.
- use_after_free — read or write a freed allocation.
- heap_overflow — write past the end of an allocation by 1 or 8 bytes.
- uninitialized read/write — access memory before initialization.
- invalid free — free a pointer not returned by the allocator.
- Build and install the app on the target device.
- Record device metadata (ROM, build fingerprint, security patch level, allocator notes).
- For each test, press the corresponding button in the UI and capture the full logcat output.
- Note the signal received, exit behavior, and any allocator-emitted error message.
- Record observations in
docs/results.mdunder the relevant ROM section.
docs/results.md: structured result log per ROM with raw logcat excerpts.