Tech News
← Back to articles

Exploring GrapheneOS secure allocator: Hardened Malloc

read original related products more articles

GrapheneOS is a mobile operating system based on Android and focusing on privacy and security. To enhance further the security of their product, GrapheneOS developers introduced a new libc allocator : hardened malloc. This allocator has a security-focused design in mind to protect processes against common memory corruption vulnerabilities. This article will explain in details its internal architecture and how security mitigation are implemented from a security researcher point of view.

Looking to improve your skills? Discover our trainings sessions! Learn more .

Introduction

GrapheneOS is a security and privacy-focused mobile operating system based on a modified version of Android (AOSP). To enhance its protection, it integrates advanced security features, including its own memory allocator for libc: hardened malloc. Designed to be as robust as the operating system itself, this allocator specifically seeks to protect against memory corruption.

This technical article details the internal workings of hardened malloc and the protection mechanisms it implements to prevent common memory corruption vulnerabilities. It is intended for a technical audience, particularly security researchers or exploit developers, who wish to gain an in-depth understanding of this allocator's internals.

The analyses and tests in this article were performed on two devices running GrapheneOS:

Pixel 4a 5G : google/bramble/bramble:14/UP1A.231105.001.B2/2025021000:user/release-keys

: Pixel 9a: google/tegu/tegu:16/BP2A.250705.008/2025071900:user/release-keys

The devices were rooted with Magisk 29 in order to use Frida to observe the internal state of hardened malloc within system processes. The study was based on the source code from the official GrapheneOS GitHub repository (commit 7481c8857faf5c6ed8666548d9e92837693de91b ).

GrapheneOS

... continue reading