summaryrefslogtreecommitdiff
path: root/drivers/crypto/cavium/cpt/cptvf_algs.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2020-06-17 09:48:56 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2020-06-26 14:46:42 +1000
commit9e27c99104707f083dccd3b4d79762859b5a0614 (patch)
treeea1ebc7ca7ae507d2072003d71e589d5b2379ae2 /drivers/crypto/cavium/cpt/cptvf_algs.c
parent758f4879ba717909cae3da5623130199f561ae29 (diff)
downloadlwn-9e27c99104707f083dccd3b4d79762859b5a0614.tar.gz
lwn-9e27c99104707f083dccd3b4d79762859b5a0614.zip
crypto: cpt - don't sleep of CRYPTO_TFM_REQ_MAY_SLEEP was not specified
There is this call chain: cvm_encrypt -> cvm_enc_dec -> cptvf_do_request -> process_request -> kzalloc where we call sleeping allocator function even if CRYPTO_TFM_REQ_MAY_SLEEP was not specified. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org # v4.11+ Fixes: c694b233295b ("crypto: cavium - Add the Virtual Function driver for CPT") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/cavium/cpt/cptvf_algs.c')
-rw-r--r--drivers/crypto/cavium/cpt/cptvf_algs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/crypto/cavium/cpt/cptvf_algs.c b/drivers/crypto/cavium/cpt/cptvf_algs.c
index 1be1adffff1d..2e4bf90c5798 100644
--- a/drivers/crypto/cavium/cpt/cptvf_algs.c
+++ b/drivers/crypto/cavium/cpt/cptvf_algs.c
@@ -200,6 +200,7 @@ static inline int cvm_enc_dec(struct skcipher_request *req, u32 enc)
int status;
memset(req_info, 0, sizeof(struct cpt_request_info));
+ req_info->may_sleep = (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) != 0;
memset(fctx, 0, sizeof(struct fc_context));
create_input_list(req, enc, enc_iv_len);
create_output_list(req, enc_iv_len);