Closed ghost closed 5 years ago
Which version of how to heap, which version of libc? Why is it compiled for 32 bit?
The source code to the binary: https://raw.githubusercontent.com/shellphish/how2heap/master/glibc_2.26/house_of_lore.c
glibc version is 2.19
The binary was compiled for a 32-bit environment because the source code indicates it was tested in a 32-bit environment:
fprintf(stderr, "This is tested against Ubuntu 14.04.4 - 32bit - glibc-2.23\n\n");
Hi @bin4ryD3struct0r
That fd and bk is not from the chunk, but from the bin.
gef➤ p main_arena.bins[0]
$3 = (mchunkptr) 0x804c000
gef➤ heap chunk 0x804c008
Chunk(addr=0x804c008, size=0x68, flags=PREV_INUSE)
Chunk size: 104 (0x68)
Usable size: 100 (0x64)
Previous chunk size: 0 (0x0)
PREV_INUSE flag: On
IS_MMAPPED flag: Off
NON_MAIN_ARENA flag: Off
Forward pointer: 0xf7fc77b0
Backward pointer: 0xf7fc77b0
gef➤ x/4wx 0x804c000
0x804c000: 0x00000000 0x00000069 0xf7fc77b0 0xf7fc77b0
gef➤ p main_arena.bins
$20 = {0x804c000, 0x804c000, 0xf7fc77b8 <main_arena+56>, ...
So you were mistaking a chunk for a bin slot, which is just an array of pointers to malloc chunks.
Your issue will be closed unless you confirm the following:
master
branch?Step 1: Describe your environment
GDB 7.7.1 using Python engine 3.4
Step 2: Describe your problem
I observed this issue while doing the house_of_lore exercise from how2heap
After the call to
free()
atmain+633
I see the following:There is one freed chunk at
0x804c008
withfd
andbk
pointers pointing to the top of the heap at0x804c000
However, when dumping the memory at this address, I see the
fd
andbk
pointers showing0xb7fbf450
Upon examining this address, I see it derefs to
0x0804c458
@Grazfather suggested this might be a caching problem and for me to open this issue.