[PATCH 3.2 01/62] Revert "crypto: algif_skcipher - Do not dereference ctx without socket lock"

From: Ben Hutchings
Date: Tue Mar 29 2016 - 16:23:43 EST


3.2.79-rc1 review patch. If anyone has any objections, please let me know.

------------------

From: Ben Hutchings <ben@xxxxxxxxxxxxxxx>

This reverts commit c54ddfbb1b691d77c52b76ca6e13ca7082eb3b82, which
was a poorly backported version of commit
6454c2b83f719057069777132b13949e4c6b6350 upstream. The small part I
was able to backport makes no sense by itself.

Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
crypto/algif_skcipher.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -249,11 +249,8 @@ static int skcipher_sendmsg(struct kiocb
{
struct sock *sk = sock->sk;
struct alg_sock *ask = alg_sk(sk);
- struct sock *psk = ask->parent;
- struct alg_sock *pask = alg_sk(psk);
struct skcipher_ctx *ctx = ask->private;
- struct ablkcipher_tfm *skc = pask->private;
- struct crypto_ablkcipher *tfm = skc->base;
+ struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(&ctx->req);
unsigned ivsize = crypto_ablkcipher_ivsize(tfm);
struct skcipher_sg_list *sgl;
struct af_alg_control con = {};