crypto: omap-aes - Fix support for unequal lengths
authorVutla, Lokesh <lokeshvutla@ti.com>
Tue, 31 Mar 2015 04:22:25 +0000 (09:52 +0530)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 17 May 2015 23:12:28 +0000 (19:12 -0400)
commitda41fc72d2fb3680fcfb1afdb9f04cc7b5aaf422
tree614d997ce4178a7ab26336a0ca38be2df3fbe139
parent9e9150becef712cfc0eebee1222f94416eab2996
crypto: omap-aes - Fix support for unequal lengths

[ Upstream commit 6d7e7e02a044025237b6f62a20521170b794537f ]

For cases where total length of an input SGs is not same as
length of the input data for encryption, omap-aes driver
crashes. This happens in the case when IPsec is trying to use
omap-aes driver.

To avoid this, we copy all the pages from the input SG list
into a contiguous buffer and prepare a single element SG list
for this buffer with length as the total bytes to crypt, which is
similar thing that is done in case of unaligned lengths.

Fixes: 6242332ff2f3 ("crypto: omap-aes - Add support for cases of unaligned lengths")
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/crypto/omap-aes.c