summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/omap-sham.c
diff options
context:
space:
mode:
authorJoel Fernandes <joelf@ti.com>2014-03-07 17:28:46 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2014-03-10 13:17:13 +0100
commit26a05489ee0eb2a69b729438e63b1038b472fa57 (patch)
treefd8bf272681f2eb72ccb10ddeec398f1dffeca22 /drivers/crypto/omap-sham.c
parentcrypto: caam - Dynamic memory allocation for caam_rng_ctx object (diff)
downloadlinux-26a05489ee0eb2a69b729438e63b1038b472fa57.tar.xz
linux-26a05489ee0eb2a69b729438e63b1038b472fa57.zip
crypto: omap-sham - Map SG pages if they are HIGHMEM before accessing
HIGHMEM pages may not be mapped so we must kmap them before accessing. This resolves a random OOPs error that was showing up during OpenSSL SHA tests. Signed-off-by: Joel Fernandes <joelf@ti.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/omap-sham.c')
-rw-r--r--drivers/crypto/omap-sham.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index 4e2067df300d..710d86386965 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -636,11 +636,17 @@ static size_t omap_sham_append_buffer(struct omap_sham_reqctx *ctx,
static size_t omap_sham_append_sg(struct omap_sham_reqctx *ctx)
{
size_t count;
+ const u8 *vaddr;
while (ctx->sg) {
+ vaddr = kmap_atomic(sg_page(ctx->sg));
+
count = omap_sham_append_buffer(ctx,
- sg_virt(ctx->sg) + ctx->offset,
+ vaddr + ctx->offset,
ctx->sg->length - ctx->offset);
+
+ kunmap_atomic((void *)vaddr);
+
if (!count)
break;
ctx->offset += count;