[PATCH] malloc: Add tcache list length integrity check

Wilco Dijkstra Wilco.Dijkstra@arm.com
Fri Jul 18 11:25:16 GMT 2025


Hi just4you/jongun/hynotist715/fuchienfriedriceclub,

+     if (cnt > tcache->counts[tc_idx])
+        malloc_printerr ("free(): tcache count mismatch");

The tcache representation has changed, so this will no longer work on current
trunk. I'm not sure how useful it is to check - we can check for lots of things,
but there is no way to detect perfectly faked chunks. Anyway, the right way to
do it would be to initialize cnt with num_slots so the existing check just works.

Cheers,
Wilco


More information about the Libc-alpha mailing list