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]
Message-ID: <55AE0995.2010209@dev.mellanox.co.il>
Date:	Tue, 21 Jul 2015 11:57:57 +0300
From:	Sagi Grimberg <sagig@....mellanox.co.il>
To:	Spencer Baugh <sbaugh@...ern.com>,
	"Nicholas A. Bellinger" <nab@...ux-iscsi.org>,
	Sagi Grimberg <sagig@...lanox.com>,
	Christoph Hellwig <hch@....de>,
	Bart Van Assche <bart.vanassche@...disk.com>,
	Andy Grover <agrover@...hat.com>,
	Christophe Vu-Brugier <cvubrugier@...tmail.fm>,
	"open list:TARGET SUBSYSTEM" <linux-scsi@...r.kernel.org>,
	"open list:TARGET SUBSYSTEM" <target-devel@...r.kernel.org>,
	open list <linux-kernel@...r.kernel.org>
Cc:	joern@...estorage.com, Alexei Potashnik <alexei@...estorage.com>
Subject: Re: [PATCH] target/iscsi: fix digest computation for chained SGs

On 7/21/2015 3:12 AM, Spencer Baugh wrote:
> From: Alexei Potashnik <alexei@...estorage.com>
>
> Current implementation assumes that all the buffers of an IO are linked
> with a single SG list. Which makes it fail if SG chaining is used.
>
> Signed-off-by: Alexei Potashnik <alexei@...estorage.com>
> ---
>   drivers/target/iscsi/iscsi_target.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
> index 4e68b62..a4cf58c 100644
> --- a/drivers/target/iscsi/iscsi_target.c
> +++ b/drivers/target/iscsi/iscsi_target.c
> @@ -1209,7 +1209,6 @@ static u32 iscsit_do_crypto_hash_sg(
>   	u8 *pad_bytes)
>   {
>   	u32 data_crc;
> -	u32 i;
>   	struct scatterlist *sg;
>   	unsigned int page_off;
>
> @@ -1218,15 +1217,15 @@ static u32 iscsit_do_crypto_hash_sg(
>   	sg = cmd->first_data_sg;
>   	page_off = cmd->first_data_sg_off;
>
> -	i = 0;
>   	while (data_length) {
> -		u32 cur_len = min_t(u32, data_length, (sg[i].length - page_off));
> +		u32 cur_len = min_t(u32, data_length, (sg->length - page_off));
>
> -		crypto_hash_update(hash, &sg[i], cur_len);
> +		crypto_hash_update(hash, sg, cur_len);
>
>   		data_length -= cur_len;
>   		page_off = 0;
> -		i++;
> +		/* iscsit_map_iovec has already checked for invalid sg pointers */
> +		sg = sg_next(sg);
>   	}
>
>   	if (padding) {
>

How were you able to get a chained SG list in the target code?

In any event, looks good,

Reviewed-by: Sagi Grimberg <sagig@...lanox.com>
--
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