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: <20210818033207.GA19350@gondor.apana.org.au>
Date:   Wed, 18 Aug 2021 11:32:07 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     Dongliang Mu <mudongliangabcd@...il.com>
Cc:     Steffen Klassert <steffen.klassert@...unet.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, dan.carpenter@...cle.com,
        syzbot+b9cfd1cc5d57ee0a09ab@...kaller.appspotmail.com,
        stable@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: xfrm: assign the per_cpu_ptr pointer before return

On Wed, Aug 18, 2021 at 11:25:53AM +0800, Dongliang Mu wrote:
>
> diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c
> index cb40ff0ff28d..01dbec70dfba 100644
> --- a/net/xfrm/xfrm_ipcomp.c
> +++ b/net/xfrm/xfrm_ipcomp.c
> @@ -223,9 +223,9 @@ static void * __percpu *ipcomp_alloc_scratches(void)
>  		void *scratch;
>  
>  		scratch = vmalloc_node(IPCOMP_SCRATCH_SIZE, cpu_to_node(i));
> +		*per_cpu_ptr(scratches, i) = scratch;
>  		if (!scratch)
>  			return NULL;
> -		*per_cpu_ptr(scratches, i) = scratch;

scratches comes from alloc_percpu so it should already be zeroed.

Cheers,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ