mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-12-16 07:28:25 +01:00
This push fixes a regression in lskcipher and an out-of-bound
access in arm64/neonbs. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEn51F/lCuNhUwmDeSxycdCkmxi6cFAmXZOpsACgkQxycdCkmx i6evnRAAzwTYyTOZFil02WUUqrmjIoiA3qMK2FiXr1wE8vTtlCvfEODGjS8T58JX nl5PU6D3/H4OJu7Z0zzjdPUbj2EQ7JSw7T+N54p8Zr4Y/Sy/XeFPWwE5XbfGuPcc 7TS3UbIpX9Gi08M5R316C4an2/8YYRsYPZUyEkm0SPvh9egDF08o62UwxJsvj7aH zKpjMjSSuxJWtzf2H9HDBlPh46u/ZFaV7kNJmrvl9Meb0XovmSCSkDWmHyOOE6TQ TNdKyWuueW/QGtuIwFYEKhzyptfpqFN7ZkX8F45b4Mx8uHzcwWTezHe6jr/pFupR APcYZfnZWanX5fbYkUmjjTkfiNO/ez9CkMRrhbexUWxafpeojlTAWtPRN3HdT8AX /UFVCgYbDjdR8CebONidyvxQn6rYahseQ7epDPDiT/EEjAxCaU+WzOCCg6pb6TpX KI3KBNq/cgvDkH3ywcTvoyS/XVRuiN8DqE+/zzLvU3po1EmcC1ZBwyKJva2/STMU J0d+g4Xxu5tY8XmO19+5ZGbY6FerbTdchTgwwNamGtnCL3B2JWDC1kUTnA/aKiFW 2umTzxKSEzQFqgAnyXGOnx584QDAOOjm3CUQvTbLH+K2E4ip5O32U2SlOmYSep3O 2EMQR1jHonEf2rUYADACk0ES4SCMftmIZV4Y4oHRoVFM+oEcyI0= =IOp0 -----END PGP SIGNATURE----- Merge tag 'v6.8-p5' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: "This fixes a regression in lskcipher and an out-of-bound access in arm64/neonbs" * tag 'v6.8-p5' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: arm64/neonbs - fix out-of-bounds access on short input crypto: lskcipher - Copy IV in lskcipher glue code always
This commit is contained in:
commit
e326df53af
|
|
@ -227,8 +227,19 @@ static int ctr_encrypt(struct skcipher_request *req)
|
|||
src += blocks * AES_BLOCK_SIZE;
|
||||
}
|
||||
if (nbytes && walk.nbytes == walk.total) {
|
||||
u8 buf[AES_BLOCK_SIZE];
|
||||
u8 *d = dst;
|
||||
|
||||
if (unlikely(nbytes < AES_BLOCK_SIZE))
|
||||
src = dst = memcpy(buf + sizeof(buf) - nbytes,
|
||||
src, nbytes);
|
||||
|
||||
neon_aes_ctr_encrypt(dst, src, ctx->enc, ctx->key.rounds,
|
||||
nbytes, walk.iv);
|
||||
|
||||
if (unlikely(nbytes < AES_BLOCK_SIZE))
|
||||
memcpy(d, dst, nbytes);
|
||||
|
||||
nbytes = 0;
|
||||
}
|
||||
kernel_neon_end();
|
||||
|
|
|
|||
|
|
@ -212,13 +212,12 @@ static int crypto_lskcipher_crypt_sg(struct skcipher_request *req,
|
|||
|
||||
ivsize = crypto_lskcipher_ivsize(tfm);
|
||||
ivs = PTR_ALIGN(ivs, crypto_skcipher_alignmask(skcipher) + 1);
|
||||
memcpy(ivs, req->iv, ivsize);
|
||||
|
||||
flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
|
||||
if (req->base.flags & CRYPTO_SKCIPHER_REQ_CONT)
|
||||
flags |= CRYPTO_LSKCIPHER_FLAG_CONT;
|
||||
else
|
||||
memcpy(ivs, req->iv, ivsize);
|
||||
|
||||
if (!(req->base.flags & CRYPTO_SKCIPHER_REQ_NOTFINAL))
|
||||
flags |= CRYPTO_LSKCIPHER_FLAG_FINAL;
|
||||
|
|
@ -234,8 +233,7 @@ static int crypto_lskcipher_crypt_sg(struct skcipher_request *req,
|
|||
flags |= CRYPTO_LSKCIPHER_FLAG_CONT;
|
||||
}
|
||||
|
||||
if (flags & CRYPTO_LSKCIPHER_FLAG_FINAL)
|
||||
memcpy(req->iv, ivs, ivsize);
|
||||
memcpy(req->iv, ivs, ivsize);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user