Re: [v2 PATCH] crypto: scomp - Fix wild memory accesses in scomp_free_streams

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 10, 2025 at 07:43:18PM -0700, Kuniyuki Iwashima wrote:
>
> I didn't move the assignment just because I was not sure if the
> immature alg->stream could be accessed by another thread.

The initialisation is conducted under the scomp lock which is taken
by everyone in init_tfm, so until the allocation completes and the
lock is dropped no other init_tfm can see the assigned value.

As to the actual users of alg->stream, it must have first passed
through a successful init_tfm call, again guaranteeing that the
value of alg->stream has been initialised.

> But if it's okay, v2 looks better to me.

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




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux