Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

W^X mmap



Hi!

Why doesn't the following code get rejected by pax mprotect?

#include <sys/mman.h>
#include <stdio.h>

int main() {
	int * a;
	a = mmap(NULL, BUFSIZ, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON, -1, 2);
	if (a == MAP_FAILED)
		printf("mmap failed\n");
	return 0;
}


thanks.


Home | Main Index | Thread Index | Old Index