File tree Expand file tree Collapse file tree 12 files changed +10
-30
lines changed
Expand file tree Collapse file tree 12 files changed +10
-30
lines changed Original file line number Diff line number Diff line change 99#define SIZE_SZ sizeof(size_t)
1010
1111#define CHUNK_HDR_SZ (SIZE_SZ*2)
12- // same for x86_64 and x86
1312#define MALLOC_ALIGN (SIZE_SZ*2)
1413#define MALLOC_MASK (-MALLOC_ALIGN)
1514
2827/**
2928 * Tested on:
3029 * + GLIBC 2.23 (x86_64, x86 & aarch64)
31- * + GLIBC 2.39 (x86_64, x86 & aarch64)
32- * + GLIBC 2.34 (x86_64, x86 & aarch64)
33- * + GLIBC 2.31 (x86_64, x86 & aarch64)
34- * + GLIBC 2.27 (x86_64, x86 & aarch64)
3530 *
3631 * sysmalloc allows us to free() the top chunk of heap to create nearly arbitrary bins,
3732 * which can be used to corrupt heap without needing to call free() directly.
Original file line number Diff line number Diff line change 99#define SIZE_SZ sizeof(size_t)
1010
1111#define CHUNK_HDR_SZ (SIZE_SZ*2)
12- // same for x86_64 and x86
1312#define MALLOC_ALIGN (SIZE_SZ*2)
1413#define MALLOC_MASK (-MALLOC_ALIGN)
1514
2827/**
2928 * Tested on:
3029 * + GLIBC 2.23 (x86_64, x86 & aarch64)
31- * + GLIBC 2.39 (x86_64, x86 & aarch64)
32- * + GLIBC 2.34 (x86_64, x86 & aarch64)
33- * + GLIBC 2.31 (x86_64, x86 & aarch64)
34- * + GLIBC 2.27 (x86_64, x86 & aarch64)
3530 *
3631 * sysmalloc allows us to free() the top chunk of heap to create nearly arbitrary bins,
3732 * which can be used to corrupt heap without needing to call free() directly.
Original file line number Diff line number Diff line change 1010
1111#define CHUNK_HDR_SZ (SIZE_SZ*2)
1212// same for x86_64 and x86
13- #define MALLOC_ALIGN (SIZE_SZ*2)
13+ #define MALLOC_ALIGN 0x10
1414#define MALLOC_MASK (-MALLOC_ALIGN)
1515
1616#define PAGESIZE sysconf(_SC_PAGESIZE)
2727
2828/**
2929 * Tested on:
30- * + GLIBC 2.23 (x86_64, x86 & aarch64)
3130 * + GLIBC 2.39 (x86_64, x86 & aarch64)
3231 * + GLIBC 2.34 (x86_64, x86 & aarch64)
3332 * + GLIBC 2.31 (x86_64, x86 & aarch64)
Original file line number Diff line number Diff line change 1010
1111#define CHUNK_HDR_SZ (SIZE_SZ*2)
1212// same for x86_64 and x86
13- #define MALLOC_ALIGN (SIZE_SZ*2)
13+ #define MALLOC_ALIGN 0x10
1414#define MALLOC_MASK (-MALLOC_ALIGN)
1515
1616#define PAGESIZE sysconf(_SC_PAGESIZE)
2727
2828/**
2929 * Tested on:
30- * + GLIBC 2.23 (x86_64, x86 & aarch64)
3130 * + GLIBC 2.39 (x86_64, x86 & aarch64)
3231 * + GLIBC 2.34 (x86_64, x86 & aarch64)
3332 * + GLIBC 2.31 (x86_64, x86 & aarch64)
Original file line number Diff line number Diff line change 1010
1111#define CHUNK_HDR_SZ (SIZE_SZ*2)
1212// same for x86_64 and x86
13- #define MALLOC_ALIGN (SIZE_SZ*2)
13+ #define MALLOC_ALIGN 0x10
1414#define MALLOC_MASK (-MALLOC_ALIGN)
1515
1616#define PAGESIZE sysconf(_SC_PAGESIZE)
2727
2828/**
2929 * Tested on:
30- * + GLIBC 2.23 (x86_64, x86 & aarch64)
3130 * + GLIBC 2.39 (x86_64, x86 & aarch64)
3231 * + GLIBC 2.34 (x86_64, x86 & aarch64)
3332 * + GLIBC 2.31 (x86_64, x86 & aarch64)
Original file line number Diff line number Diff line change 1010
1111#define CHUNK_HDR_SZ (SIZE_SZ*2)
1212// same for x86_64 and x86
13- #define MALLOC_ALIGN (SIZE_SZ*2)
13+ #define MALLOC_ALIGN 0x10
1414#define MALLOC_MASK (-MALLOC_ALIGN)
1515
1616#define PAGESIZE sysconf(_SC_PAGESIZE)
2727
2828/**
2929 * Tested on:
30- * + GLIBC 2.23 (x86_64, x86 & aarch64)
3130 * + GLIBC 2.39 (x86_64, x86 & aarch64)
3231 * + GLIBC 2.34 (x86_64, x86 & aarch64)
3332 * + GLIBC 2.31 (x86_64, x86 & aarch64)
Original file line number Diff line number Diff line change 1010
1111#define CHUNK_HDR_SZ (SIZE_SZ*2)
1212// same for x86_64 and x86
13- #define MALLOC_ALIGN (SIZE_SZ*2)
13+ #define MALLOC_ALIGN 0x10
1414#define MALLOC_MASK (-MALLOC_ALIGN)
1515
1616#define PAGESIZE sysconf(_SC_PAGESIZE)
2727
2828/**
2929 * Tested on:
30- * + GLIBC 2.23 (x86_64, x86 & aarch64)
3130 * + GLIBC 2.39 (x86_64, x86 & aarch64)
3231 * + GLIBC 2.34 (x86_64, x86 & aarch64)
3332 * + GLIBC 2.31 (x86_64, x86 & aarch64)
Original file line number Diff line number Diff line change 1010
1111#define CHUNK_HDR_SZ (SIZE_SZ*2)
1212// same for x86_64 and x86
13- #define MALLOC_ALIGN (SIZE_SZ*2)
13+ #define MALLOC_ALIGN 0x10
1414#define MALLOC_MASK (-MALLOC_ALIGN)
1515
1616#define PAGESIZE sysconf(_SC_PAGESIZE)
2727
2828/**
2929 * Tested on:
30- * + GLIBC 2.23 (x86_64, x86 & aarch64)
3130 * + GLIBC 2.39 (x86_64, x86 & aarch64)
3231 * + GLIBC 2.34 (x86_64, x86 & aarch64)
3332 * + GLIBC 2.31 (x86_64, x86 & aarch64)
Original file line number Diff line number Diff line change 1010
1111#define CHUNK_HDR_SZ (SIZE_SZ*2)
1212// same for x86_64 and x86
13- #define MALLOC_ALIGN (SIZE_SZ*2)
13+ #define MALLOC_ALIGN 0x10
1414#define MALLOC_MASK (-MALLOC_ALIGN)
1515
1616#define PAGESIZE sysconf(_SC_PAGESIZE)
2727
2828/**
2929 * Tested on:
30- * + GLIBC 2.23 (x86_64, x86 & aarch64)
3130 * + GLIBC 2.39 (x86_64, x86 & aarch64)
3231 * + GLIBC 2.34 (x86_64, x86 & aarch64)
3332 * + GLIBC 2.31 (x86_64, x86 & aarch64)
Original file line number Diff line number Diff line change 1010
1111#define CHUNK_HDR_SZ (SIZE_SZ*2)
1212// same for x86_64 and x86
13- #define MALLOC_ALIGN (SIZE_SZ*2)
13+ #define MALLOC_ALIGN 0x10
1414#define MALLOC_MASK (-MALLOC_ALIGN)
1515
1616#define PAGESIZE sysconf(_SC_PAGESIZE)
2727
2828/**
2929 * Tested on:
30- * + GLIBC 2.23 (x86_64, x86 & aarch64)
3130 * + GLIBC 2.39 (x86_64, x86 & aarch64)
3231 * + GLIBC 2.34 (x86_64, x86 & aarch64)
3332 * + GLIBC 2.31 (x86_64, x86 & aarch64)
You can’t perform that action at this time.
0 commit comments