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] [day] [month] [year] [list]
Message-Id: <77D903B4-E63F-4633-8D5B-C39EFC067FB8@oracle.com>
Date:   Tue, 11 Dec 2018 07:32:07 -0700
From:   William Kucharski <william.kucharski@...cle.com>
To:     Huang Ying <ying.huang@...el.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org,
        Vineeth Remanan Pillai <vpillai@...italocean.com>,
        Kelley Nielsen <kelleynnn@...il.com>,
        Rik van Riel <riel@...riel.com>,
        Matthew Wilcox <willy@...radead.org>,
        Hugh Dickins <hughd@...gle.com>
Subject: Re: [PATCH 2/2] swap: Deal with PTE mapped THP when unuse PTE



> ---
> mm/swapfile.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 7464d0a92869..9e6da494781f 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -1921,10 +1921,8 @@ static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
> 			goto out;
> 		}
> 
> -		if (PageSwapCache(page) && (swap_count(*swap_map) == 0))
> -			delete_from_swap_cache(compound_head(page));
> +		try_to_free_swap(page);
> 
> -		SetPageDirty(page);
> 		unlock_page(page);
> 		put_page(page);
> 
> -- 
> 2.18.1
> 

Since try_to_free_swap() can return 0 under certain error conditions, you should check
check for a return status of 1 before calling unlock_page() and put_page().

Reviewed-by: William Kucharski <william.kucharski@...cle.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ