WCU / Cybersecurity
~/CSC 472/Class 09/KP 21
Class 09 · KP 21 / 25

Defenses: Hardening the Heap

allocated chunksizeheaderuser datafreed chunk (tcache)sizeheaderfd → next freereused by UAFUse-after-free: the pointer still works after free — read, or overwrite fd.
glibc heap: a dangling pointer to a freed chunk becomes a read/write primitive.

Developer discipline: null out pointers after free,

avoid manual lifetime juggling, use smart pointers / RAII in C++.

Key Takeaway

Defense in depth: allocator checks, read-only GOT, randomization, and safe coding each remove a rung of the ladder.