Exploring GrapheneOS’ secure allocator: hardened malloc

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.

↫ Nicolas Stefanski at Synacktiv

GrapheneOS is quite possibly the best way to keep your smartphone secure, and even law enforcement is not particularly amused that people are using it. If the choice is between security and convenience, GrapheneOS chooses security every time, and that’s the reason it’s favoured by many people who deeply care about (smartphone) security. The project’s social media accounts can be a bit… Much at times, but their dedication to security is without question, and if you want a secure smartphone, there’s really nowhere else to turn – unless you opt to trust the black box security approach from Apple.

Sadly, GrapheneOS is effectively under attack not from criminals, but from Google itself. As Google tightens its grip on Android more and more, as we’ve been reporting on for years now, it will become ever harder for GrapheneOS to deliver the kind of security and fast update they’ve been able to deliver. I don’t know just how consequential Google’s increasing pressure is for GrapheneOS, but I doubt it’s making the lives of its developers any easier.

It’s self-defeating, too; GrapheneOS has a long history of basically serving as a test best for highly advanced security features Google later implements for Android in general. A great example is the Memory Tagging Extension, a feature implemented by ARM in hardware, which GrapheneOS implements much more widely and extensively than Google does. This way, GrapheneOS users have basically been serving as testers to see if applications and other components experience any issues when using the feature, paving the way for Google to eventually, hopefully, follow in GrapheneOS’ footsteps.

Google benefits from GrapheneOS, and trying to restrict its ability to properly support devices and its access to updates is shortsighted.

Leave a Reply