diff options
author | Gilad Ben-Yossef <gilad@benyossef.com> | 2020-01-29 15:37:54 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2020-02-13 10:05:24 +0100 |
commit | ce0fc6db38decf0d2919bfe783de6d6b76e421a9 (patch) | |
tree | 3e6b3bcab86364c8ded48f79fc9ea9f0188d8f28 /drivers/crypto/ccree/cc_buffer_mgr.h | |
parent | crypto: x86/curve25519 - replace with formally verified implementation (diff) | |
download | linux-ce0fc6db38decf0d2919bfe783de6d6b76e421a9.tar.xz linux-ce0fc6db38decf0d2919bfe783de6d6b76e421a9.zip |
crypto: ccree - protect against empty or NULL scatterlists
Deal gracefully with a NULL or empty scatterlist which can happen
if both cryptlen and assoclen are zero and we're doing in-place
AEAD encryption.
This fixes a crash when this causes us to try and map a NULL page,
at least with some platforms / DMA mapping configs.
Cc: stable@vger.kernel.org # v4.19+
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccree/cc_buffer_mgr.h')
-rw-r--r-- | drivers/crypto/ccree/cc_buffer_mgr.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/crypto/ccree/cc_buffer_mgr.h b/drivers/crypto/ccree/cc_buffer_mgr.h index af434872c6ff..827b6cb1236e 100644 --- a/drivers/crypto/ccree/cc_buffer_mgr.h +++ b/drivers/crypto/ccree/cc_buffer_mgr.h @@ -25,6 +25,7 @@ enum cc_sg_cpy_direct { struct cc_mlli { cc_sram_addr_t sram_addr; + unsigned int mapped_nents; unsigned int nents; //sg nents unsigned int mlli_nents; //mlli nents might be different than the above }; |