lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 1 Apr 2015 22:18:14 +0800
From:	Herbert Xu <herbert@...dor.apana.org.au>
To:	Lokesh Vutla <lokeshvutla@...com>
Cc:	linux-crypto@...r.kernel.org, linux-omap@...r.kernel.org,
	linux-kernel@...r.kernel.org, nsekhar@...com, t-kristo@...com
Subject: Re: [PATCH] crypto: omap-sham: Check for HIGHMEM before mapping SG
 pages

On Tue, Mar 31, 2015 at 09:52:23AM +0530, Lokesh Vutla wrote:
> Commit 26a05489ee0e ("crypto: omap-sham - Map SG pages if they are HIGHMEM before accessing")
> says that HIGHMEM pages may not be mapped so we must
> kmap them before accessing, but it doesn't check whether the
> corresponding page is in highmem or not. Because of this all
> the crypto tests are failing.
> 
> 00000000: d9 a1 1b 7c aa 90 3b aa 11 ab cb 25 00 b8 ac bf
> [    2.338169] 00000010: c1 39 cd ff 48 d0 a8 e2 2b fa 33 a1
> [    2.344008] alg: hash: Chunking test 1 failed for omap-sha256
> 
> So Checking for HIGHMEM before mapping SG pages.
> 
> Fixes: 26a05489ee0 ("crypto: omap-sham - Map SG pages if they are HIGHMEM before accessing")
> Signed-off-by: Lokesh Vutla <lokeshvutla@...com>
> ---
>  drivers/crypto/omap-sham.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
> index 3c76696..ace5852 100644
> --- a/drivers/crypto/omap-sham.c
> +++ b/drivers/crypto/omap-sham.c
> @@ -639,13 +639,17 @@ static size_t omap_sham_append_sg(struct omap_sham_reqctx *ctx)
>  	const u8 *vaddr;
>  
>  	while (ctx->sg) {
> -		vaddr = kmap_atomic(sg_page(ctx->sg));
> +		if (PageHighMem(sg_page(ctx->sg)))
> +			vaddr = kmap_atomic(sg_page(ctx->sg));
> +		else
> +			vaddr = sg_virt(ctx->sg);

This is completely bogus.  kmap_atomic should be identical to
sg_virt(sg_page()) for the lowmem case.

So either your architecture is broken (because the same problem
would obviously affect the core crypto code which does exactly
the same thing), or there is some other bug causing the selftest
to fail.

Cheers,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ