This push contains the following changes:

- Fix bug in crypto_skcipher that breaks the new ti driver.
 - Check for invalid assoclen in essiv.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEn51F/lCuNhUwmDeSxycdCkmxi6cFAmjnXoQACgkQxycdCkmx
 i6creg//RRuKOEC2MGnoQDWZCCjI0PY8tWdzhh9cdbYeU9gwD3pZf8RsJfEEjij7
 wmgTD5331mBKM1gQ4IpngWB28n+XqlAxcRqbGiv9ApDi9AjmRq5nlyusrYJhdleX
 hVH/2MBI+lDtET6gHKwv+Wx5bA2++uP1kjGp+JeT0rEztif9CK2aIdlRyBfHdndk
 26ZotkWh8QVsS1V/qC7/E7h20ANswKaPuhCNsBpq8EbOuXJgY1/p6B9u6KeX+69f
 MtHk3a9XizZBHluIU3egows12T4/0VqQixiyN6PsvIbuOqqVYMRJ3MU6C1oSpSPw
 iHzjidEKqYDpjtaon6yOXJpG7qTB+/ZZdVPNdR4b7JmHvxzgIzuvu9J8y4kL3BXi
 j7ND6ZXv6nr0Cb2+pB5RkTk1zUvaHqvCLNlj0vEOJcXc1p0LEklNso6R7/+c24Ho
 4zN7D89yNU7w3VR/DLzE877LpsYnPQr2sn/VzwCC33UGaghKliTo2ytcH4lmzjyh
 A2sII/UnC16B90ikO66r0BPIy+HWE3NfGI5+9qzlrTvVjCbzapQVDVJIYZFKBpmF
 CO2Q1UFXUFJpJb8i51XkG8XE+H93nOSlLARRtdx12cu0ycuuWrwuGLUBgPcvV4pj
 xmJi9CxO+kNLqJ0GbLaemS+rNJ2mwNAKSU34ihu2Rbx3B3vebL0=
 =F8H0
 -----END PGP SIGNATURE-----

Merge tag 'v6.18-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:

 - Fix bug in crypto_skcipher that breaks the new ti driver

 - Check for invalid assoclen in essiv

* tag 'v6.18-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: essiv - Check ssize for decryption and in-place encryption
  crypto: skcipher - Fix reqsize handling
This commit is contained in:
Linus Torvalds 2025-10-10 08:56:16 -07:00
commit 0ae452440c
2 changed files with 8 additions and 8 deletions

View File

@ -186,9 +186,14 @@ static int essiv_aead_crypt(struct aead_request *req, bool enc)
const struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
struct essiv_aead_request_ctx *rctx = aead_request_ctx(req);
struct aead_request *subreq = &rctx->aead_req;
int ivsize = crypto_aead_ivsize(tfm);
int ssize = req->assoclen - ivsize;
struct scatterlist *src = req->src;
int err;
if (ssize < 0)
return -EINVAL;
crypto_cipher_encrypt_one(tctx->essiv_cipher, req->iv, req->iv);
/*
@ -198,19 +203,12 @@ static int essiv_aead_crypt(struct aead_request *req, bool enc)
*/
rctx->assoc = NULL;
if (req->src == req->dst || !enc) {
scatterwalk_map_and_copy(req->iv, req->dst,
req->assoclen - crypto_aead_ivsize(tfm),
crypto_aead_ivsize(tfm), 1);
scatterwalk_map_and_copy(req->iv, req->dst, ssize, ivsize, 1);
} else {
u8 *iv = (u8 *)aead_request_ctx(req) + tctx->ivoffset;
int ivsize = crypto_aead_ivsize(tfm);
int ssize = req->assoclen - ivsize;
struct scatterlist *sg;
int nents;
if (ssize < 0)
return -EINVAL;
nents = sg_nents_for_len(req->src, ssize);
if (nents < 0)
return -EINVAL;

View File

@ -294,6 +294,8 @@ static int crypto_skcipher_init_tfm(struct crypto_tfm *tfm)
return crypto_init_lskcipher_ops_sg(tfm);
}
crypto_skcipher_set_reqsize(skcipher, crypto_tfm_alg_reqsize(tfm));
if (alg->exit)
skcipher->base.exit = crypto_skcipher_exit_tfm;