From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Cc: akpm@linux-foundation.org,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] mm: Recheck page table entry with page table lock held
Date: Wed, 26 Sep 2018 15:40:32 +0300 [thread overview]
Message-ID: <20180926124032.gxvo43sisumybysu@kshutemo-mobl1> (raw)
In-Reply-To: <20180926031858.9692-1-aneesh.kumar@linux.ibm.com>
On Wed, Sep 26, 2018 at 08:48:58AM +0530, Aneesh Kumar K.V wrote:
> We clear the pte temporarily during read/modify/write update of the pte. If we
> take a page fault while the pte is cleared, the application can get SIGBUS. One
> such case is with remap_pfn_range without a backing vm_ops->fault callback.
> do_fault will return SIGBUS in that case.
>
> cpu 0 cpu1
> mprotect()
> ptep_modify_prot_start()/pte cleared.
> .
> . page fault.
> .
> .
> prep_modify_prot_commit()
>
> Fix this by taking page table lock and rechecking for pte_none.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> ---
> V1:
> * update commit message.
You choosed to stick with VM_FAULT_NOPAGE, that's fine.
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Should it be in stable?
--
Kirill A. Shutemov
next prev parent reply other threads:[~2018-09-26 12:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-26 3:18 Aneesh Kumar K.V
2018-09-26 12:40 ` Kirill A. Shutemov [this message]
2019-10-25 3:13 ` Figo.zhang
2019-10-28 12:08 ` Kirill A. Shutemov
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=20180926124032.gxvo43sisumybysu@kshutemo-mobl1 \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.ibm.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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