lkml.org 
[lkml]   [2023]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [EXT] Re: [PATCH] crypto: caam: Clear some memory in instantiate_rng()
Date
Hi

> -----Original Message-----
> From: Herbert Xu <herbert@gondor.apana.org.au>
> Sent: Tuesday, March 21, 2023 10:37 AM
> To: Gaurav Jain <gaurav.jain@nxp.com>
> Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>; Horia Geanta
> <horia.geanta@nxp.com>; Pankaj Gupta <pankaj.gupta@nxp.com>;
> davem@davemloft.net; linux-crypto@vger.kernel.org; linux-
> kernel@vger.kernel.org; kernel-janitors@vger.kernel.org
> Subject: Re: [EXT] Re: [PATCH] crypto: caam: Clear some memory in
> instantiate_rng()
>
> Caution: EXT Email
>
> On Tue, Mar 21, 2023 at 05:03:24AM +0000, Gaurav Jain wrote:
> >
> > memset() is needed to clear the desc for each state handle before
> recreating descriptor.
> > So it is required.
>
> OK so we should move it to the top of the loop then.
kzalloc() will zeroize the contents of desc for the first time.
In this case memset() is ok at the end for instantiating other rng handles.

Thanks
Gaurav

>
> Thanks,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page:
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgondor
> .apana.org.au%2F~herbert%2F&data=05%7C01%7Cgaurav.jain%40nxp.com%
> 7C46125a50355a466bbd6208db29ca159a%7C686ea1d3bc2b4c6fa92cd99c5c3
> 01635%7C0%7C0%7C638149720177317067%7CUnknown%7CTWFpbGZsb3d8
> eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3
> D%7C3000%7C%7C%7C&sdata=DmvSAsFT0dY%2FL%2FP5lcw90hR0FYAKRdnI
> kZxiaMN1MVk%3D&reserved=0
> PGP Key:
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgondor
> .apana.org.au%2F~herbert%2Fpubkey.txt&data=05%7C01%7Cgaurav.jain%4
> 0nxp.com%7C46125a50355a466bbd6208db29ca159a%7C686ea1d3bc2b4c6fa
> 92cd99c5c301635%7C0%7C0%7C638149720177317067%7CUnknown%7CTWF
> pbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
> CI6Mn0%3D%7C3000%7C%7C%7C&sdata=8NA1ediu3cnWLFbisXecjq5Z%2BuK
> uztPYtlcRDCPSMno%3D&reserved=0

\
 
 \ /
  Last update: 2023-03-27 01:10    [W:0.053 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site