summaryrefslogtreecommitdiff
path: root/malloc/arena.c
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/arena.c')
-rw-r--r--malloc/arena.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index 33c4ff37a7..be25386c78 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -59,7 +59,7 @@ typedef struct _heap_info {
struct _heap_info *prev; /* Previous heap. */
size_t size; /* Current size in bytes. */
size_t mprotect_size; /* Size in bytes that has been mprotected
- PROT_READ|PROT_WRITE. */
+ PROT_READ|PROT_WRITE|MALLOC_PROT_EXEC. */
/* Make sure the following data is properly aligned, particularly
that sizeof (heap_info) + 2 * SIZE_SZ is a multiple of
MALLOC_ALIGNMENT. */
@@ -599,7 +599,7 @@ grow_heap(heap_info *h, long diff)
if((unsigned long) new_size > h->mprotect_size) {
if (__mprotect((char *)h + h->mprotect_size,
(unsigned long) new_size - h->mprotect_size,
- PROT_READ|PROT_WRITE) != 0)
+ PROT_READ|PROT_WRITE|MALLOC_PROT_EXEC) != 0)
return -2;
h->mprotect_size = new_size;
}