]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
crypto: algif_skcipher - Do not dereference ctx without socket lock
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 3 Feb 2016 13:39:26 +0000 (21:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Feb 2016 20:31:05 +0000 (12:31 -0800)
commit66bca97f21762ba58ce3d6767b27f782c702ef65
tree6a5b523f10d04d148764aa8697c9637a8877993c
parent3e597bb7c3be2c69c03a6af95d27d5ed16b7b882
crypto: algif_skcipher - Do not dereference ctx without socket lock

commit 6454c2b83f719057069777132b13949e4c6b6350 upstream.

Any access to non-constant bits of the private context must be
done under the socket lock, in particular, this includes ctx->req.

This patch moves such accesses under the lock, and fetches the
tfm from the parent socket which is guaranteed to be constant,
rather than from ctx->req.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/algif_skcipher.c