Skip to content

Commit

Permalink
context_stack.c: rm PROT_EXEC (#652)
Browse files Browse the repository at this point in the history
PROT_EXEC allows to execute code from coroutine stack, which is useless
feature, and moreover, this is not secure.

Signed-off-by: Roman Khapov <[email protected]>
Co-authored-by: Roman Khapov <[email protected]>
  • Loading branch information
rkhapov and Roman Khapov authored Aug 8, 2024
1 parent e573c7a commit 73468ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion third_party/machinarium/sources/context_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int mm_contextstack_create(mm_contextstack_t *stack, size_t size,
size_t size_guard)
{
char *base;
base = mmap(0, size_guard + size, PROT_READ | PROT_WRITE | PROT_EXEC,
base = mmap(0, size_guard + size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (base == MAP_FAILED)
return -1;
Expand Down

0 comments on commit 73468ec

Please sign in to comment.