From: Jan Stancek <jstancek@redhat.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Cc: Rachel Sibley <rasibley@redhat.com>,
linuxppc-dev@lists.ozlabs.org, sandipan@linux.ibm.com,
linuxram@us.ibm.com
Subject: Re: [bug] LTP mmap03 stuck in page fault loop after c46241a370a6 ("powerpc/pkeys: Check vma before returning key fault error to the user")
Date: Fri, 26 Jun 2020 05:49:04 -0400 (EDT) [thread overview]
Message-ID: <240479777.18793651.1593164944980.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <a55e7ccd-09e8-726a-21d2-02b00b48d857@linux.ibm.com>
----- 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
prev parent reply other threads:[~2020-06-26 9:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1402271372.18777802.1593153800272.JavaMail.zimbra@redhat.com>
2020-06-26 6:59 ` [bug] LTP mmap03 stuck in page fault loop after c46241a370a6 ("powerpc/pkeys: Check vma before returning key fault error to the user") Jan Stancek
2020-06-26 7:47 ` Aneesh Kumar K.V
2020-06-26 9:09 ` Aneesh Kumar K.V
2020-06-26 9:49 ` Jan Stancek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=240479777.18793651.1593164944980.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=aneesh.kumar@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=linuxram@us.ibm.com \
--cc=rasibley@redhat.com \
--cc=sandipan@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).