Re: [PATCH] crypto: do not free algorithm before using

From: Herbert Xu
Date: Thu Nov 29 2018 - 03:29:20 EST


On Thu, Nov 29, 2018 at 03:47:56PM +0800, PanBian wrote:
> On Thu, Nov 29, 2018 at 02:57:11PM +0800, Herbert Xu wrote:
> > On Thu, Nov 22, 2018 at 06:00:16PM +0800, Pan Bian wrote:
> > > In multiple functions, the algorithm fields are read after its reference
> > > is dropped through crypto_mod_put. In this case, the algorithm memory
> > > may be freed, resulting in use-after-free bugs. This patch delays the
> > > put operation until the algorithm is never used.
> > >
> > > Signed-off-by: Pan Bian <bianpan2016@xxxxxxx>
> >
> > Patch applied. Thanks!
> >
> > BTW, this problem exists in almost every other skcipher template,
> > e.g., in ctr. Are you working on a fix for them too?
>
> Probably not. Could you please provide patches to fix them?

OK, I'll work on it then.

Thanks!
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt