Content-Length: 33500 | pFad | http://lwn.net/ml/linux-mm/F33D2DD9-97D5-44A0-890B-35FE686E36DC@gmail.com/

Re: [PATCH] mm/userfaultfd: fix memory corruption due to writeprotect [LWN.net]
|
|
Subscribe / Log in / New account

Re: [PATCH] mm/userfaultfd: fix memory corruption due to writeprotect

Thread information [Search the linux-mm archive]
 Nadav Amit
 ` Andrea Arcangeli
     ` Nadav Amit
       ` Andrea Arcangeli
         ` Nadav Amit
           ` Yu Zhao
             ` Nadav Amit
               ` Nadav Amit
                 ` Yu Zhao
       ` Andy Lutomirski
         ` Nadav Amit
           ` Andrea Arcangeli
     ` Andy Lutomirski
       ` Andrea Arcangeli
         ` Andy Lutomirski
           ` Andrea Arcangeli
             ` Andy Lutomirski
     ` Yu Zhao
       ` Nadav Amit
         ` Yu Zhao
           ` Nadav Amit
             ` Yu Zhao
         ` Peter Xu
           ` Nadav Amit
             ` Yu Zhao
               ` Linus Torvalds
                 ` Yu Zhao
                   ` Linus Torvalds
                 ` Nadav Amit
                   ` Linus Torvalds
                     ` Yu Zhao
                       ` Nadav Amit
                         ` Peter Xu
                           ` Nadav Amit
                             ` Linus Torvalds
                               ` Nadav Amit
                             ` Andrea Arcangeli
                               ` Nadav Amit
                                 ` Andrea Arcangeli
                           ` Yu Zhao
                             ` Linus Torvalds
                               ` Yu Zhao
                                 ` Linus Torvalds
                                   ` Yu Zhao
                           ` Linus Torvalds
                             ` Andy Lutomirski
                               ` Linus Torvalds
                                 ` Andy Lutomirski
                                 ` Peter Zijlstra
                                   ` Andrea Arcangeli
                                     ` Peter Zijlstra
                                   ` Vinayak Menon
                                     ` Laurent Dufour
                                       ` Peter Zijlstra
                                         ` Laurent Dufour
                                           ` Nadav Amit
                                             ` Yu Zhao
                                               ` Nadav Amit
                                                 ` Yu Zhao
                                                 ` Will Deacon
                                                   ` Nadav Amit [this message]
                                                     ` Will Deacon
                                                     ` Andy Lutomirski
                                                   ` Yu Zhao
                                                     ` Nadav Amit
                                                       ` Yu Zhao
                                                         ` Nadav Amit
                                                           ` Yu Zhao
                                                             ` Nadav Amit
                               ` Nadav Amit
                               ` Andrea Arcangeli
                                 ` Matthew Wilcox
                                   ` Andrea Arcangeli
                                 ` Yu Zhao
                                   ` Andrea Arcangeli
                                     ` Yu Zhao
                                       ` Linus Torvalds
                                         ` Linus Torvalds
                                           ` Yu Zhao
                                             ` Andrea Arcangeli
                                           ` Linus Torvalds
                                             ` Yu Zhao
                                               ` Peter Xu
                                                 ` Andrea Arcangeli
                                                   ` Andrea Arcangeli
                                                 ` Yu Zhao
                                                   ` Peter Xu
                                         ` Linus Torvalds
                                       ` Andrea Arcangeli
                                         ` Yu Zhao
                                           ` Peter Xu
                                             ` Andrea Arcangeli
                                           ` Andrea Arcangeli
                                             ` Yu Zhao
                                               ` Andrea Arcangeli
                                               ` Andy Lutomirski
                                                 ` Andrea Arcangeli
                                                   ` Nadav Amit
                                                     ` Nadav Amit
                                                     ` Yu Zhao
                                                       ` Andrea Arcangeli
                                                         ` Nadav Amit
                                                           ` Andrea Arcangeli
                                                             ` Andrea Arcangeli
                                                       ` Nadav Amit
                                                   ` Andrea Arcangeli
                                             ` Linus Torvalds
                                               ` Andrea Arcangeli
                                 ` Nadav Amit
                       ` Nadav Amit
                         ` Yu Zhao
                           ` Nadav Amit
                             ` Will Deacon
                               ` Nadav Amit
                         ` Andrea Arcangeli
                           ` Nadav Amit
                             ` Andrea Arcangeli
                   ` Peter Xu
                     ` Linus Torvalds
             ` Peter Xu

From:  Nadav Amit <nadav.amit-AT-gmail.com>
To:  Will Deacon <will-AT-kernel.org>
Subject:  Re: [PATCH] mm/userfaultfd: fix memory corruption due to writeprotect
Date:  Tue, 12 Jan 2021 14:29:51 -0800
Message-ID:  <F33D2DD9-97D5-44A0-890B-35FE686E36DC@gmail.com>
Cc:  Yu Zhao <yuzhao-AT-google.com>, Laurent Dufour <ldufour-AT-linux.vnet.ibm.com>, Peter Zijlstra <peterz-AT-infradead.org>, Vinayak Menon <vinmenon-AT-codeaurora.org>, Linus Torvalds <torvalds-AT-linux-foundation.org>, Andy Lutomirski <luto-AT-kernel.org>, Peter Xu <peterx-AT-redhat.com>, Andrea Arcangeli <aarcange-AT-redhat.com>, linux-mm <linux-mm-AT-kvack.org>, lkml <linux-kernel-AT-vger.kernel.org>, Pavel Emelyanov <xemul-AT-openvz.org>, Mike Kravetz <mike.kravetz-AT-oracle.com>, Mike Rapoport <rppt-AT-linux.vnet.ibm.com>, stable <stable-AT-vger.kernel.org>, Minchan Kim <minchan-AT-kernel.org>, surenb-AT-google.com

> On Jan 12, 2021, at 1:43 PM, Will Deacon <will@kernel.org> wrote:
> 
> On Tue, Jan 12, 2021 at 12:38:34PM -0800, Nadav Amit wrote:
>>> On Jan 12, 2021, at 11:56 AM, Yu Zhao <yuzhao@google.com> wrote:
>>> On Tue, Jan 12, 2021 at 11:15:43AM -0800, Nadav Amit wrote:
>>>> I will send an RFC soon for per-table deferred TLB flushes tracking.
>>>> The basic idea is to save a generation in the page-struct that tracks
>>>> when deferred PTE change took place, and track whenever a TLB flush
>>>> completed. In addition, other users - such as mprotect - would use
>>>> the tlb_gather interface.
>>>> 
>>>> Unfortunately, due to limited space in page-struct this would only
>>>> be possible for 64-bit (and my implementation is only for x86-64).
>>> 
>>> I don't want to discourage you but I don't think this would end up
>>> well. PPC doesn't necessarily follow one-page-struct-per-table rule,
>>> and I've run into problems with this before while trying to do
>>> something similar.
>> 
>> Discourage, discourage. Better now than later.
>> 
>> It will be relatively easy to extend the scheme to be per-VMA instead of
>> per-table for architectures that prefer it this way. It does require
>> TLB-generation tracking though, which Andy only implemented for x86, so I
>> will focus on x86-64 right now.
> 
> Can you remind me of what we're missing on arm64 in this area, please? I'm
> happy to help get this up and running once you have something I can build
> on.

Let me first finish making something that we can use as a basis for a
discussion. I do not waste your time before I have something ready.



Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://lwn.net/ml/linux-mm/F33D2DD9-97D5-44A0-890B-35FE686E36DC@gmail.com/

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy