Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: qce - Return error for zero length messages

Crypto engine BAM dma does not support 0 length data. Return unsupported
if zero length messages are passed for transformation.

Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Thara Gopinath and committed by
Herbert Xu
f0878946 42f730a4

+5
+5
drivers/crypto/qce/skcipher.c
··· 8 8 #include <linux/interrupt.h> 9 9 #include <linux/moduleparam.h> 10 10 #include <linux/types.h> 11 + #include <linux/errno.h> 11 12 #include <crypto/aes.h> 12 13 #include <crypto/internal/des.h> 13 14 #include <crypto/internal/skcipher.h> ··· 260 259 rctx->flags = tmpl->alg_flags; 261 260 rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; 262 261 keylen = IS_XTS(rctx->flags) ? ctx->enc_keylen >> 1 : ctx->enc_keylen; 262 + 263 + /* CE does not handle 0 length messages */ 264 + if (!req->cryptlen) 265 + return 0; 263 266 264 267 /* qce is hanging when AES-XTS request len > QCE_SECTOR_SIZE and 265 268 * is not a multiple of it; pass such requests to the fallback