The program uses a region of stack and heap for handling various values during run-time.
A variable size of allocating on the stack is decided at the compile-time. Conversely, allocating the variable to using memory allocator such as
malloc , size will be deciding at the run-time.
Assuming a various situation, Both of regions have the potential to vulnerability if unexpected exceptions occur without exception handling while a program handling an arbitrary value.
Understand memory allocator and heap structure has been an integral part of heap exploitation.
In this article, I describe heap's management and manipulating based on ptmalloc2.
ptmalloc2 memory allocator has implemented on glibc and depend on the version, implementations are slightly different.
Basically, fundamental heap structures are not different as much.
Among various memory allocators, ptmalloc2 has these characterizations.
mallocat the same time, heap segment created on each thread and Arena management that area.