본문 바로가기

Heap analysis

(42)
(glibc 2.29) get_max_fast 휴가나가면 할것
(glibc 2.29) tcache_put 전체 코드 아래 더보기 더보기 /* Caller must ensure that we know tc_idx is valid and there's room for more chunks. */ static __always_inline void tcache_put (mchunkptr chunk, size_t tc_idx) { tcache_entry *e = (tcache_entry *) chunk2mem (chunk); assert (tc_idx key = tcache; e->next = tcache->en..
(glibc 2.29) tcache_get 전체 코드 더보기 더보기 /* Caller must ensure that we know tc_idx is valid and there's available chunks to remove. */ static __always_inline void * tcache_get (size_t tc_idx) { tcache_entry *e = tcache->entries[tc_idx]; assert (tc_idx entries[tc_idx] > 0); tcache->entries[tc_idx] = e->next; --(tcache->counts[tc_idx]); e->key = NULL; return (void *) e; } get address poin..
(glibc 2.29) tcache_init 전체 코드는 아래 더보기 더보기 static void tcache_init(void) { mstate ar_ptr; void *victim = 0; const size_t bytes = sizeof (tcache_perthread_struct); if (tcache_shutting_down) return; arena_get (ar_ptr, bytes); victim = _int_malloc (ar_ptr, bytes); if (!victim && ar_ptr != NULL) { ar_ptr = arena_get_retry (ar_ptr, bytes); victim = _int_malloc (ar_ptr, bytes); } if (ar_ptr != NULL) __libc_lock_unlock (ar_ptr..
UAF 보호되어 있는 글입니다.
fastbin dup & tcache dup 보호되어 있는 글입니다.
(glibc 2.29) _int_free glibc 2.26버전과 비교했을때 핵심 부분만 작성할 것이다 더보기 인자 및 변수 (삭제) 변경 및 추가된 코드 선언되는 일부 변수 삭제 더보기 const char *errstr = NULL; int locked = 0; 2.26버전에서 사용되었던 locked와 errstr가 삭제되었다 이를 통해 해당 버전에서는 errstr에 에러 시 출력될 문자열을 errstr에 저장해 출력하는 것이 아닌 malloc_printerrr를 통해 출력한다 initial_check (변경, 추가) 변경 및 추가된 코드 errorout 레이블 삭제 tcache관련 코드 추가 및 변경 더보기 errorout 레이블 삭제 if (__builtin_expect ((uintptr_t) p > (uintptr_t) -size, 0)..
(glibc 2.29) free 2.26버전과 동일하다