Skip to content

Commit

Permalink
Merge pull request #184 from gfelber/master
Browse files Browse the repository at this point in the history
fixed sysmalloc_int_free.c MALLOC_ALIGN
  • Loading branch information
Kyle-Kyle authored May 2, 2024
2 parents 385b8b3 + 31bd3ba commit c6a55fe
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 30 deletions.
5 changes: 0 additions & 5 deletions glibc_2.23/sysmalloc_int_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#define SIZE_SZ sizeof(size_t)

#define CHUNK_HDR_SZ (SIZE_SZ*2)
// same for x86_64 and x86
#define MALLOC_ALIGN (SIZE_SZ*2)
#define MALLOC_MASK (-MALLOC_ALIGN)

Expand All @@ -28,10 +27,6 @@
/**
* Tested on:
* + GLIBC 2.23 (x86_64, x86 & aarch64)
* + GLIBC 2.39 (x86_64, x86 & aarch64)
* + GLIBC 2.34 (x86_64, x86 & aarch64)
* + GLIBC 2.31 (x86_64, x86 & aarch64)
* + GLIBC 2.27 (x86_64, x86 & aarch64)
*
* sysmalloc allows us to free() the top chunk of heap to create nearly arbitrary bins,
* which can be used to corrupt heap without needing to call free() directly.
Expand Down
5 changes: 0 additions & 5 deletions glibc_2.24/sysmalloc_int_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#define SIZE_SZ sizeof(size_t)

#define CHUNK_HDR_SZ (SIZE_SZ*2)
// same for x86_64 and x86
#define MALLOC_ALIGN (SIZE_SZ*2)
#define MALLOC_MASK (-MALLOC_ALIGN)

Expand All @@ -28,10 +27,6 @@
/**
* Tested on:
* + GLIBC 2.23 (x86_64, x86 & aarch64)
* + GLIBC 2.39 (x86_64, x86 & aarch64)
* + GLIBC 2.34 (x86_64, x86 & aarch64)
* + GLIBC 2.31 (x86_64, x86 & aarch64)
* + GLIBC 2.27 (x86_64, x86 & aarch64)
*
* sysmalloc allows us to free() the top chunk of heap to create nearly arbitrary bins,
* which can be used to corrupt heap without needing to call free() directly.
Expand Down
3 changes: 1 addition & 2 deletions glibc_2.27/sysmalloc_int_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define CHUNK_HDR_SZ (SIZE_SZ*2)
// same for x86_64 and x86
#define MALLOC_ALIGN (SIZE_SZ*2)
#define MALLOC_ALIGN 0x10
#define MALLOC_MASK (-MALLOC_ALIGN)

#define PAGESIZE sysconf(_SC_PAGESIZE)
Expand All @@ -27,7 +27,6 @@

/**
* Tested on:
* + GLIBC 2.23 (x86_64, x86 & aarch64)
* + GLIBC 2.39 (x86_64, x86 & aarch64)
* + GLIBC 2.34 (x86_64, x86 & aarch64)
* + GLIBC 2.31 (x86_64, x86 & aarch64)
Expand Down
3 changes: 1 addition & 2 deletions glibc_2.31/sysmalloc_int_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define CHUNK_HDR_SZ (SIZE_SZ*2)
// same for x86_64 and x86
#define MALLOC_ALIGN (SIZE_SZ*2)
#define MALLOC_ALIGN 0x10
#define MALLOC_MASK (-MALLOC_ALIGN)

#define PAGESIZE sysconf(_SC_PAGESIZE)
Expand All @@ -27,7 +27,6 @@

/**
* Tested on:
* + GLIBC 2.23 (x86_64, x86 & aarch64)
* + GLIBC 2.39 (x86_64, x86 & aarch64)
* + GLIBC 2.34 (x86_64, x86 & aarch64)
* + GLIBC 2.31 (x86_64, x86 & aarch64)
Expand Down
3 changes: 1 addition & 2 deletions glibc_2.32/sysmalloc_int_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define CHUNK_HDR_SZ (SIZE_SZ*2)
// same for x86_64 and x86
#define MALLOC_ALIGN (SIZE_SZ*2)
#define MALLOC_ALIGN 0x10
#define MALLOC_MASK (-MALLOC_ALIGN)

#define PAGESIZE sysconf(_SC_PAGESIZE)
Expand All @@ -27,7 +27,6 @@

/**
* Tested on:
* + GLIBC 2.23 (x86_64, x86 & aarch64)
* + GLIBC 2.39 (x86_64, x86 & aarch64)
* + GLIBC 2.34 (x86_64, x86 & aarch64)
* + GLIBC 2.31 (x86_64, x86 & aarch64)
Expand Down
3 changes: 1 addition & 2 deletions glibc_2.33/sysmalloc_int_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define CHUNK_HDR_SZ (SIZE_SZ*2)
// same for x86_64 and x86
#define MALLOC_ALIGN (SIZE_SZ*2)
#define MALLOC_ALIGN 0x10
#define MALLOC_MASK (-MALLOC_ALIGN)

#define PAGESIZE sysconf(_SC_PAGESIZE)
Expand All @@ -27,7 +27,6 @@

/**
* Tested on:
* + GLIBC 2.23 (x86_64, x86 & aarch64)
* + GLIBC 2.39 (x86_64, x86 & aarch64)
* + GLIBC 2.34 (x86_64, x86 & aarch64)
* + GLIBC 2.31 (x86_64, x86 & aarch64)
Expand Down
3 changes: 1 addition & 2 deletions glibc_2.34/sysmalloc_int_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define CHUNK_HDR_SZ (SIZE_SZ*2)
// same for x86_64 and x86
#define MALLOC_ALIGN (SIZE_SZ*2)
#define MALLOC_ALIGN 0x10
#define MALLOC_MASK (-MALLOC_ALIGN)

#define PAGESIZE sysconf(_SC_PAGESIZE)
Expand All @@ -27,7 +27,6 @@

/**
* Tested on:
* + GLIBC 2.23 (x86_64, x86 & aarch64)
* + GLIBC 2.39 (x86_64, x86 & aarch64)
* + GLIBC 2.34 (x86_64, x86 & aarch64)
* + GLIBC 2.31 (x86_64, x86 & aarch64)
Expand Down
3 changes: 1 addition & 2 deletions glibc_2.35/sysmalloc_int_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define CHUNK_HDR_SZ (SIZE_SZ*2)
// same for x86_64 and x86
#define MALLOC_ALIGN (SIZE_SZ*2)
#define MALLOC_ALIGN 0x10
#define MALLOC_MASK (-MALLOC_ALIGN)

#define PAGESIZE sysconf(_SC_PAGESIZE)
Expand All @@ -27,7 +27,6 @@

/**
* Tested on:
* + GLIBC 2.23 (x86_64, x86 & aarch64)
* + GLIBC 2.39 (x86_64, x86 & aarch64)
* + GLIBC 2.34 (x86_64, x86 & aarch64)
* + GLIBC 2.31 (x86_64, x86 & aarch64)
Expand Down
3 changes: 1 addition & 2 deletions glibc_2.36/sysmalloc_int_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define CHUNK_HDR_SZ (SIZE_SZ*2)
// same for x86_64 and x86
#define MALLOC_ALIGN (SIZE_SZ*2)
#define MALLOC_ALIGN 0x10
#define MALLOC_MASK (-MALLOC_ALIGN)

#define PAGESIZE sysconf(_SC_PAGESIZE)
Expand All @@ -27,7 +27,6 @@

/**
* Tested on:
* + GLIBC 2.23 (x86_64, x86 & aarch64)
* + GLIBC 2.39 (x86_64, x86 & aarch64)
* + GLIBC 2.34 (x86_64, x86 & aarch64)
* + GLIBC 2.31 (x86_64, x86 & aarch64)
Expand Down
3 changes: 1 addition & 2 deletions glibc_2.37/sysmalloc_int_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define CHUNK_HDR_SZ (SIZE_SZ*2)
// same for x86_64 and x86
#define MALLOC_ALIGN (SIZE_SZ*2)
#define MALLOC_ALIGN 0x10
#define MALLOC_MASK (-MALLOC_ALIGN)

#define PAGESIZE sysconf(_SC_PAGESIZE)
Expand All @@ -27,7 +27,6 @@

/**
* Tested on:
* + GLIBC 2.23 (x86_64, x86 & aarch64)
* + GLIBC 2.39 (x86_64, x86 & aarch64)
* + GLIBC 2.34 (x86_64, x86 & aarch64)
* + GLIBC 2.31 (x86_64, x86 & aarch64)
Expand Down
3 changes: 1 addition & 2 deletions glibc_2.38/sysmalloc_int_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define CHUNK_HDR_SZ (SIZE_SZ*2)
// same for x86_64 and x86
#define MALLOC_ALIGN (SIZE_SZ*2)
#define MALLOC_ALIGN 0x10
#define MALLOC_MASK (-MALLOC_ALIGN)

#define PAGESIZE sysconf(_SC_PAGESIZE)
Expand All @@ -27,7 +27,6 @@

/**
* Tested on:
* + GLIBC 2.23 (x86_64, x86 & aarch64)
* + GLIBC 2.39 (x86_64, x86 & aarch64)
* + GLIBC 2.34 (x86_64, x86 & aarch64)
* + GLIBC 2.31 (x86_64, x86 & aarch64)
Expand Down
3 changes: 1 addition & 2 deletions glibc_2.39/sysmalloc_int_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define CHUNK_HDR_SZ (SIZE_SZ*2)
// same for x86_64 and x86
#define MALLOC_ALIGN (SIZE_SZ*2)
#define MALLOC_ALIGN 0x10
#define MALLOC_MASK (-MALLOC_ALIGN)

#define PAGESIZE sysconf(_SC_PAGESIZE)
Expand All @@ -27,7 +27,6 @@

/**
* Tested on:
* + GLIBC 2.23 (x86_64, x86 & aarch64)
* + GLIBC 2.39 (x86_64, x86 & aarch64)
* + GLIBC 2.34 (x86_64, x86 & aarch64)
* + GLIBC 2.31 (x86_64, x86 & aarch64)
Expand Down

0 comments on commit c6a55fe

Please sign in to comment.