[PATCH] D35778: Add NetBSD PaX MPROTECT support in allocateMappedMemory
Kamil Rytarowski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 23 23:26:00 PDT 2017
krytarowski added a comment.
The following code triggers failure specific to NetBSD:
$ cat mprotect.c
#include <sys/types.h>
#include <sys/mman.h>
#include <errno.h>
#include <stdio.h>
int
main(int argc, char **argv)
{
void *p = mmap(0, 0x1000, PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0);
int ret = mprotect(p, 0x1000, PROT_READ | PROT_WRITE);
printf("ret=%d errno=%d\n", ret, errno);
return 0;
}
$ ./a.out
ret=-1 errno=13
Repository:
rL LLVM
https://reviews.llvm.org/D35778
More information about the llvm-commits
mailing list