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

Allocated vs. Free Chunk Layout

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.
  • When a chunk is freed, malloc overwrites the first bytes of the old user data with list pointers (fd/bk).
  • Those pointers form the free lists (bins). Controlling them means controlling where malloc allocates next.