Commit 8c8f269a authored by Herbert Xu's avatar Herbert Xu
Browse files

crypto: aspeed/hash - Fix potential overflow in dma_prepare_sg



The mapped SG lists are written to hash_engine->ahash_src_addr which
has the size ASPEED_HASH_SRC_DMA_BUF_LEN.  Since scatterlists are
not bound in size, make sure that size is not exceeded.

If the mapped SG list is larger than the buffer, simply iterate
over it as is done in the dma_prepare case.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 0602f0ef
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment