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: <ZKXO0/2sC3/dvLO7@casper.infradead.org>
Date:   Wed, 5 Jul 2023 21:13:07 +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 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?

Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ