All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@linux.vnet.ibm.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	linux-scsi@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] ipr: Read buffer overflow
Date: Fri, 07 Aug 2009 17:16:11 -0500	[thread overview]
Message-ID: <4A7CA7AB.4010103@linux.vnet.ibm.com> (raw)
In-Reply-To: <4A7CA52C.9030407@gmail.com>

Roel Kluin wrote:
> If `sglist->num_dma_sg' is zero we write ioadl[-1]
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> Is it possible for sglist->num_dma_sg to be 0?

No. Its not possible. The code in ipr_update_ioa_ucode ensures this.

Thanks,

Brian

> 
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index 5f04550..736ad07 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -3004,8 +3004,9 @@ static void ipr_build_ucode_ioadl(struct ipr_cmnd *ipr_cmd,
>  			cpu_to_be32(sg_dma_address(&scatterlist[i]));
>  	}
> 
> -	ioadl[i-1].flags_and_data_len |=
> -		cpu_to_be32(IPR_IOADL_FLAGS_LAST);
> +	if (i != 0)
> +		ioadl[i-1].flags_and_data_len |=
> +			cpu_to_be32(IPR_IOADL_FLAGS_LAST);
>  }
> 
>  /**
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Brian King
Linux on Power Virtualization
IBM Linux Technology Center



      reply	other threads:[~2009-08-07 22:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-07 22:05 [PATCH] ipr: Read buffer overflow Roel Kluin
2009-08-07 22:16 ` Brian King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A7CA7AB.4010103@linux.vnet.ibm.com \
    --to=brking@linux.vnet.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=roel.kluin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.