]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: algif_aead - Fix bogus request dereference in completion function
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 10 Apr 2017 09:59:07 +0000 (17:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Apr 2017 07:32:41 +0000 (09:32 +0200)
commit25308983eda6354815f7f1f6dd01afeef786a876
treec2b5b0dac2c5a8db9ccbfe0ccc6ad5e777920226
parenta0a1e90f5057f69055d880c96257b98035feca71
crypto: algif_aead - Fix bogus request dereference in completion function

commit e6534aebb26e32fbab14df9c713c65e8507d17e4 upstream.

The algif_aead completion function tries to deduce the aead_request
from the crypto_async_request argument.  This is broken because
the API does not guarantee that the same request will be pased to
the completion function.  Only the value of req->data can be used
in the completion function.

This patch fixes it by storing a pointer to sk in areq and using
that instead of passing in sk through req->data.

Fixes: 83094e5e9e49 ("crypto: af_alg - add async support to...")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/algif_aead.c