Skip to content

Commit

Permalink
crypto: omap-sham - Map SG pages if they are HIGHMEM before accessing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joel Fernandes authored and Herbert Xu committed Mar 10, 2014
1 parent 6e4e603 commit 26a0548
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/crypto/omap-sham.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 26a0548

Please sign in to comment.