본문 바로가기

system/material

unsorted bin free 동작..

danglingPtr

danglingPtr.c

free(qlist[1]) ( main+188 ) breakpoint


  • qlist[1] heap status before free

  • qlits[1] heap status after free

-> 128 (0x80) 만큼 할당한 후 free 한다면 unsortedbin으로 들어간 후 fd와 bk가 main_arena+88 영역이 되어야 할건데 그냥 사라져버린다??


test.c

a (main+78) breakpoint

 

  • a heap status before free

  • a heap status after free

-> unsortedbin에 들어간 후 mainarena+88 영역이 잘 들어가 있다. 즉 데이터 재사용이 불가능하다.

 

위 두 예제를 봤을 때 prev_size와 inuse_bit를 기록 할 chunk가 존재하지 않는다면 bin 구조에 들어가지 않음을 알 수 있다.


 #2019.01.22 추가

consolidate with top chunk


environ: ubuntu 16.04, xshell 6



'system > material' 카테고리의 다른 글

c++ std::string  (0) 2019.01.22
fastbin dup consolidate 정리  (0) 2019.01.22
x86, x64 srop 정리  (0) 2019.01.21
glibc 2.26 tcache 동작 분석 및 exploit (how2heap)  (2) 2019.01.15
got_overwrite stack_smashing_detected  (0) 2019.01.12