On Fri, Oct 04, 2019 at 08:55:37AM +0000, [email protected] wrote: > From: Tudor Ambarus <[email protected]> > > commit 394a9e044702 ("crypto: cfb - add missing 'chunksize' property") > adds a test vector where the input length is smaller than the IV length > (the second test vector). This revealed a NULL pointer dereference in > the atmel-aes driver, that is caused by passing an incorrect offset in > scatterwalk_map_and_copy() when atmel_aes_complete() is called. > > Do not save the IV in req->info of ablkcipher_request (or equivalently > req->iv of skcipher_request) when req->nbytes < ivsize, because the IV > will not be further used. > > While touching the code, modify the type of ivsize from int to > unsigned int, to comply with the return type of > crypto_ablkcipher_ivsize(). > > Fixes: 91308019ecb4 ("crypto: atmel-aes - properly set IV after {en,de}crypt") > Signed-off-by: Tudor Ambarus <[email protected]> > --- > drivers/crypto/atmel-aes.c | 53 > ++++++++++++++++++++++++++-------------------- > 1 file changed, 30 insertions(+), 23 deletions(-)
Patch applied. Thanks. -- Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
