linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: Jan Stancek <jstancek@redhat.com>,
	linuxppc-dev@lists.ozlabs.org, sandipan@linux.ibm.com
Cc: Rachel Sibley <rasibley@redhat.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 13:17:48 +0530	[thread overview]
Message-ID: <ac99e243-0945-8be0-6ae4-73af29b7a199@linux.ibm.com> (raw)
In-Reply-To: <2065283975.18780128.1593154755849.JavaMail.zimbra@redhat.com>

Hi Jan,

On 6/26/20 12:29 PM, Jan Stancek wrote:
> Hi,
> 
> LTP mmap03 is getting stuck in page fault loop after commit
>    c46241a370a6 ("powerpc/pkeys: Check vma before returning key fault error to the user")
> 
> System is ppc64le P9 lpar [1] running v5.8-rc2-34-g3e08a95294a4.
> 
> Here's a minimized reproducer:
> ------------------------- 8< -----------------------------
> #include <fcntl.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> #include <sys/mman.h>
> 
> int main(int ac, char **av)
> {
>          int page_sz = getpagesize();
>          int fildes;
>          char *addr;
> 
>          fildes = open("tempfile", O_WRONLY | O_CREAT, 0666);
>          write(fildes, &fildes, sizeof(fildes));
>          close(fildes);
> 
>          fildes = open("tempfile", O_RDONLY);
>          unlink("tempfile");
> 
>          addr = mmap(0, page_sz, PROT_EXEC, MAP_FILE | MAP_PRIVATE, fildes, 0);
> 
>          printf("%d\n", *addr);
>          return 0;
> }
> ------------------------- >8 -----------------------------

Thanks for the report. This is execute only key where vma has the 
implied read permission. So The patch do break this case. I will see how 
best we can handle  PROT_EXEC and the multi threaded test that required 
the change in the patch.


-aneesh

  reply	other threads:[~2020-06-26  7:49 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 [this message]
2020-06-26  9:09     ` Aneesh Kumar K.V
2020-06-26  9:49       ` Jan Stancek

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=ac99e243-0945-8be0-6ae4-73af29b7a199@linux.ibm.com \
    --to=aneesh.kumar@linux.ibm.com \
    --cc=jstancek@redhat.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --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).