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]
Date:   Wed, 5 Jul 2023 21:19:32 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Sidhartha Kumar <sidhartha.kumar@...cle.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        akpm@...ux-foundation.org
Subject: Re: [PATCH v2 3/4] mm/memory: convert do_shared_fault() to folios

On Wed, Jul 05, 2023 at 01:16:25PM -0700, Sidhartha Kumar wrote:
> On 7/5/23 1:13 PM, Matthew Wilcox wrote:
> > On Wed, Jul 05, 2023 at 12:43:34PM -0700, Sidhartha Kumar wrote:
> > >   	/*
> > >   	 * Check if the backing address space wants to know that the page is
> > >   	 * about to become writable
> > >   	 */
> > >   	if (vma->vm_ops->page_mkwrite) {
> > > -		unlock_page(vmf->page);
> > > +		folio_unlock(folio);
> > >   		tmp = do_page_mkwrite(vmf);
> > >   		if (unlikely(!tmp ||
> > >   				(tmp & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))) {
> > > -			put_page(vmf->page);
> > > +			folio_put(folio);
> > 
> > This is _probably_ OK.  However, do_page_mkwrite() calls
> > vm_ops->page_mkwrite(), and I think it's theoretically possible for the
> > driver to replace vmf->page with a different one.  The chance of them
> > actually doing that is pretty low (particularly if they return error or
> > nopage!), but I'm going to flag it just in case it comes up.
> > 
> > Also, should we pass a folio to do_page_mkwrite() instead of having it
> > extract the folio from vmf->page?
> 
> I can take a look at doing this in a follow-up patch.
> > 
> > Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
> 
> Did you mean for this to be reviewed-by?

Uh, yes.  Maybe I need to get more rest ...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ