[bug] LTP mmap03 stuck in page fault loop after c46241a370a6 ("powerpc/pkeys: Check vma before returning key fault error to the user")
Jan Stancek
jstancek at redhat.com
Fri Jun 26 19:49:04 AEST 2020
----- Original Message -----
> Can you check with this change? While checking for access permission we
> are checking against UAMOR value which i think is wrong. We just need to
> look at the AMR and IAMR values to check whether access is permitted or
> not. Even if UAMOR deny the userspace management of the key, we should
> do the correct access check.
>
> modified arch/powerpc/mm/book3s64/pkeys.c
> @@ -353,9 +353,6 @@ static bool pkey_access_permitted(int pkey, bool
> write, bool execute)
> int pkey_shift;
> u64 amr;
>
> - if (!is_pkey_enabled(pkey))
> - return true;
> -
> pkey_shift = pkeyshift(pkey);
> if (execute && !(read_iamr() & (IAMR_EX_BIT << pkey_shift)))
> return true;
>
This change fixes it for me. mmap03 and reproducer from previous
email no longer get stuck.
Thanks,
Jan
More information about the Linuxppc-dev
mailing list