diff --git a/mm/mprotect.c b/mm/mprotect.c index 516b1d847e2c..0d37a7308cd9 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -726,11 +727,11 @@ static int do_mprotect_pkey(unsigned long start, size_t len, if (grows == (PROT_GROWSDOWN|PROT_GROWSUP)) /* can't be both */ return -EINVAL; - if (start & ~PAGE_MASK) + if (!__PAGE_ALIGNED(start)) return -EINVAL; if (!len) return 0; - len = PAGE_ALIGN(len); + len = __PAGE_ALIGN(len); end = start + len; if (end <= start) return -ENOMEM;