lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190910091515.GE14442@C02TF0J2HF1T.local>
Date:   Tue, 10 Sep 2019 10:15:15 +0100
From:   Catalin Marinas <catalin.marinas@....com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     Jia He <justin.he@....com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Jérôme Glisse <jglisse@...hat.com>,
        Ralph Campbell <rcampbell@...dia.com>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Peter Zijlstra <peterz@...radead.org>,
        Dave Airlie <airlied@...hat.com>,
        "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>,
        Thomas Hellstrom <thellstrom@...are.com>,
        Souptick Joarder <jrdr.linux@...il.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mm: fix double page fault on arm64 if PTE_AF is
 cleared

On Fri, Sep 06, 2019 at 07:57:42AM -0700, Matthew Wilcox wrote:
> On Fri, Sep 06, 2019 at 09:57:47PM +0800, Jia He wrote:
> >  		 * This really shouldn't fail, because the page is there
> >  		 * in the page tables. But it might just be unreadable,
> >  		 * in which case we just give up and fill the result with
> > -		 * zeroes.
> > +		 * zeroes. If PTE_AF is cleared on arm64, it might
> > +		 * cause double page fault. So makes pte young here
> 
> How about:
> 		 * zeroes. On architectures with software "accessed" bits,
> 		 * we would take a double page fault here, so mark it
> 		 * accessed here.
> 
> >  		 */
> > +		if (!pte_young(vmf->orig_pte)) {
> 
> Let's guard this with:
> 
> 		if (arch_sw_access_bit && !pte_young(vmf->orig_pte)) {
> 
> #define arch_sw_access_bit	0
> by default and have arm64 override it (either to a variable or a constant
> ... your choice).  Also, please somebody decide on a better name than
> arch_sw_access_bit.

I'm not good at names either (is arch_faults_on_old_pte any better?) but
I'd make this a 0 args call: arch_sw_access_bit(). This way we can make
it a static inline function on arm64 with some static label check.

-- 
Catalin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ