Commit 26a05489 authored by Joel Fernandes's avatar Joel Fernandes Committed by Herbert Xu

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: default avatarJoel Fernandes <joelf@ti.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 6e4e603a
...@@ -636,11 +636,17 @@ static size_t omap_sham_append_buffer(struct omap_sham_reqctx *ctx, ...@@ -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) static size_t omap_sham_append_sg(struct omap_sham_reqctx *ctx)
{ {
size_t count; size_t count;
const u8 *vaddr;
while (ctx->sg) { while (ctx->sg) {
vaddr = kmap_atomic(sg_page(ctx->sg));
count = omap_sham_append_buffer(ctx, count = omap_sham_append_buffer(ctx,
sg_virt(ctx->sg) + ctx->offset, vaddr + ctx->offset,
ctx->sg->length - ctx->offset); ctx->sg->length - ctx->offset);
kunmap_atomic((void *)vaddr);
if (!count) if (!count)
break; break;
ctx->offset += count; ctx->offset += count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment