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.

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

+8 -8
+6 -8
crypto/essiv.c
··· 186 186 const struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm); 187 187 struct essiv_aead_request_ctx *rctx = aead_request_ctx(req); 188 188 struct aead_request *subreq = &rctx->aead_req; 189 + int ivsize = crypto_aead_ivsize(tfm); 190 + int ssize = req->assoclen - ivsize; 189 191 struct scatterlist *src = req->src; 190 192 int err; 193 + 194 + if (ssize < 0) 195 + return -EINVAL; 191 196 192 197 crypto_cipher_encrypt_one(tctx->essiv_cipher, req->iv, req->iv); 193 198 ··· 203 198 */ 204 199 rctx->assoc = NULL; 205 200 if (req->src == req->dst || !enc) { 206 - scatterwalk_map_and_copy(req->iv, req->dst, 207 - req->assoclen - crypto_aead_ivsize(tfm), 208 - crypto_aead_ivsize(tfm), 1); 201 + scatterwalk_map_and_copy(req->iv, req->dst, ssize, ivsize, 1); 209 202 } else { 210 203 u8 *iv = (u8 *)aead_request_ctx(req) + tctx->ivoffset; 211 - int ivsize = crypto_aead_ivsize(tfm); 212 - int ssize = req->assoclen - ivsize; 213 204 struct scatterlist *sg; 214 205 int nents; 215 - 216 - if (ssize < 0) 217 - return -EINVAL; 218 206 219 207 nents = sg_nents_for_len(req->src, ssize); 220 208 if (nents < 0)
+2
crypto/skcipher.c
··· 294 294 return crypto_init_lskcipher_ops_sg(tfm); 295 295 } 296 296 297 + crypto_skcipher_set_reqsize(skcipher, crypto_tfm_alg_reqsize(tfm)); 298 + 297 299 if (alg->exit) 298 300 skcipher->base.exit = crypto_skcipher_exit_tfm; 299 301