ptmalloc
Glibc dynamic memory allocator
Last updated
Glibc dynamic memory allocator
Last updated
ptmalloc2 is the dynamic memory allocator used by glibc since version 2.3.x. It is a fork of the original malloc with improved multi-threading support. It is also very fast (6 times faster) compared to the original malloc. Specifically, we are interested in the implementation of malloc.c
. The very first step of getting into heap exploitation is reading malloc.c
and understanding its algorithms.
Download and extract the latest glibc (the current version is 2.35):
The malloc.c
file can be found at /usr/src/glibc/glibc-2.35/malloc
.