Enforce W^X in mprotect() as well
This commit is contained in:
parent
a86a774ce8
commit
c51c10b78f
|
@ -48,6 +48,12 @@ int mprotect(void * addr, size_t length, int prot)
|
|||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
/* enforce W^X */
|
||||
if((prot & (PROT_WRITE | PROT_EXEC)) == (PROT_WRITE | PROT_EXEC))
|
||||
{
|
||||
errno = EPERM;
|
||||
return MAP_FAILED;
|
||||
}
|
||||
/* FIXME really implement */
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user