This article by Nicolas Stefanski at Synacktiv provides a high quality technical overview of our hardened_malloc project used in GrapheneOS:

https://www.synacktiv.com/en/publications/exploring-grapheneos-secure-allocator-hardened-malloc

It has great coverage of the memory layout, memory tagging integration, slab quarantines and allocation approach.

Exploring GrapheneOS secure allocator: Hardened Malloc

Exploring GrapheneOS secure allocator: Hardened Malloc

Synacktiv
@GrapheneOS this is fascinating to me! i use hardened malloc on my qubes os workstation on all my vms, but don't have the skills to evaluate the code. this writeup is immensely enlightening
@xyhhx It's a very good article and we only consider one minor thing incorrect which we explained here (the comparison between our canaries and Scudo inline metadata checksums). We don't think it gets anything wrong about hardened_malloc itself, and it's only missing 1 thing we think should be covered (write-after-free check. Maybe they'll make some minor edits to improve those things.