[PATCHv3] malloc: Make sure tcache_key is odd enough
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Mon Aug 4 10:12:44 GMT 2025
Hi Cupertino,
> In order to avoid having tcache_key repeated through memory, why don't
> we mangle it as well with, maybe not exactly as in PROTECT_PTR, however
> using the location of chunk. A XOR perhaps ?
>
> I don't think it would have such a huge performance impact on the
> overhaul execution time.
What problem would that solve? The detection of double-free in tcache is
already quite limited. Using many different "keys" would only increase
collisions with user data (which is what we are trying to avoid with this patch).
Cheers,
Wilco
More information about the Libc-alpha
mailing list