crypto: sahara - fix processing requests with cryptlen < sg->length
authorOvidiu Panait <ovidiu.panait@windriver.com>
Fri, 1 Dec 2023 17:06:22 +0000 (19:06 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 Dec 2023 03:59:45 +0000 (11:59 +0800)
commit5b8668ce3452827d27f8c34ff6ba080a8f983ed0
tree00dc4b550ad5e9eaaa851165e054cc17d9b1fefa
parentafffcf3db98b9495114b79d5381f8cc3f69476fb
crypto: sahara - fix processing requests with cryptlen < sg->length

It's not always the case that the entire sg entry needs to be processed.
Currently, when cryptlen is less than sg->legth, "Descriptor length" errors
are encountered.

The error was noticed when testing xts(sahara-ecb-aes) with arbitrary sized
input data. To fix this, take the actual request size into account when
populating the hw links.

Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/sahara.c