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] [day] [month] [year] [list]
Date:	Tue, 11 Aug 2015 22:06:13 +0800
From:	Herbert Xu <herbert@...dor.apana.org.au>
To:	Jan Stancek <jstancek@...hat.com>
Cc:	linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
	leosilva@...ux.vnet.ibm.com, mhcerri@...ux.vnet.ibm.com,
	fin@...ux.vnet.ibm.com, davem@...emloft.net
Subject: Re: [PATCH] crypto: nx-sha256/512: respect sg limit bounds when
 building sg lists

On Sat, Aug 08, 2015 at 08:47:28AM +0200, Jan Stancek wrote:
> Commit 000851119e80 changed sha256/512 update functions to
> pass more data to nx_build_sg_list(), which ends with
> sg list overflows and usually with update functions failing
> for data larger than max_sg_len * NX_PAGE_SIZE.
> 
> This happens because:
> - both "total" and "to_process" are updated, which leads to
>   "to_process" getting overflowed for some data lengths
>   For example:
>     In first iteration "total" is 50, and let's assume "to_process"
>     is 30 due to sg limits. At the end of first iteration "total" is
>     set to 20. At start of 2nd iteration "to_process" overflows on:
>       to_process = total - to_process;
> - "in_sg" is not reset to nx_ctx->in_sg after each iteration
> - nx_build_sg_list() is hitting overflow because the amount of data
>   passed to it would require more than sgmax elements
> - as consequence of previous item, data stored in overflowed sg list
>   may no longer be aligned to SHA*_BLOCK_SIZE
> 
> This patch changes sha256/512 update functions so that "to_process"
> respects sg limits and never tries to pass more data to
> nx_build_sg_list() to avoid overflows. "to_process" is calculated
> as minimum of "total" and sg limits at start of every iteration.
> 
> Fixes: 000851119e80 ("crypto: nx - Fix SHA concurrence issue and sg
>                       limit bounds")
> 
> Signed-off-by: Jan Stancek <jstancek@...hat.com>
> Cc: Leonidas Da Silva Barbosa <leosilva@...ux.vnet.ibm.com>
> Cc: Marcelo Henrique Cerri <mhcerri@...ux.vnet.ibm.com>
> Cc: Fionnuala Gunter <fin@...ux.vnet.ibm.com>
> Cc: Herbert Xu <herbert@...dor.apana.org.au>
> Cc: "David S. Miller" <davem@...emloft.net>

Patch applied with stable cc.  Thanks a lot!
-- 
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