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: <dc8b03de1e3318e3dd577d80482260f99ab4e9a5.camel@hpe.com>
Date:   Fri, 14 Sep 2018 20:37:48 +0000
From:   "Kani, Toshi" <toshi.kani@....com>
To:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "will.deacon@....com" <will.deacon@....com>
CC:     "tglx@...utronix.de" <tglx@...utronix.de>,
        "cpandya@...eaurora.org" <cpandya@...eaurora.org>,
        "Hocko, Michal" <MHocko@...e.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Subject: Re: [PATCH 3/5] x86: pgtable: Drop pXd_none() checks from
 pXd_free_pYd_table()

On Wed, 2018-09-12 at 11:26 +0100, Will Deacon wrote:
> Now that the core code checks this for us, we don't need to do it in the
> backend.
> 
> Cc: Chintan Pandya <cpandya@...eaurora.org>
> Cc: Toshi Kani <toshi.kani@....com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Michal Hocko <mhocko@...e.com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Will Deacon <will.deacon@....com>
> ---
>  arch/x86/mm/pgtable.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
> index ae394552fb94..b4919c44a194 100644
> --- a/arch/x86/mm/pgtable.c
> +++ b/arch/x86/mm/pgtable.c
> @@ -796,9 +796,6 @@ int pud_free_pmd_page(pud_t *pud, unsigned long addr)
>  	pte_t *pte;
>  	int i;
>  
> -	if (pud_none(*pud))
> -		return 1;
> -

Do we need to remove this safe guard?  I feel list this is same as
kfree() accepting NULL.

Thanks,
-Toshi


>  	pmd = (pmd_t *)pud_page_vaddr(*pud);
>  	pmd_sv = (pmd_t *)__get_free_page(GFP_KERNEL);
>  	if (!pmd_sv)
> @@ -840,9 +837,6 @@ int pmd_free_pte_page(pmd_t *pmd, unsigned long addr)
>  {
>  	pte_t *pte;
>  
> -	if (pmd_none(*pmd))
> -		return 1;
> -
>  	pte = (pte_t *)pmd_page_vaddr(*pmd);
>  	pmd_clear(pmd);
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ