The slab allocation quarantine in the new hardened allocator has been refined a bit and is now enabled by default. It scales the size of the quarantines based on the size of the allocations to keep the memory footprint reasonable:
github.com/AndroidHardeni
It's not cheap though.
Conversation
It has a significant performance cost, but it's reasonable as long as the base quarantine size is chosen to be a power of 2. It might make sense to add that as one of the future sanity checks for the configuration. There's not much that could be done to further reduce the cost.
1
It's a very important security feature, so the added overhead for freeing small allocations just has to be accepted for the default configuration. It can be disabled by setting the slab quarantine lengths to 0 if the cost is too high, like some of the other security features.
