crypto: omap-sham: Map SG pages if they are HIGHMEM before accessing
PATCH v3 1/1 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 <[email protected]>
---
v2: Don't check for HIGHMEM, already done by kmap/unmap
v3: Use atomic as call can happen in irq context.
drivers/crypto/omap-sham.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/crypto/omap-sham.c +7 -1
@@ -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;
Signature · 1 line
1.7.9.5
Herbert Xu
maintainerQuoted 4 lines · Joel Fernandes
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 <[email protected]>
Patch applied. Thanks!
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt