The mprotect syscall protects the memory area within page boundary:
int mprotect(void *addr, size_t len, int prot);
Here len
should be multiple of pagesize.
Is there any way to protect only a few consecutive addresses, which are not aligned to page boundary i.e. len < pagesize
?