mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Insu Yun <wuninsu@gmail.com>,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: taesoo@gatech.edu, yeongjin.jang@gatech.edu, insu@gatech.edu,
	changwoo@gatech.edu
Subject: Re: [PATCH] scsi: fix potential integer signedness problem
Date: Mon, 18 Jan 2016 12:14:50 -0800	[thread overview]
Message-ID: <1453148090.2363.13.camel@HansenPartnership.com> (raw)
In-Reply-To: <1453146909-28314-1-git-send-email-wuninsu@gmail.com>

On Mon, 2016-01-18 at 14:55 -0500, Insu Yun wrote:
> Since len is signed integer variable, it is better to check
> whether len is non-negative or not.
> If non-negative value len gives, it can cause heap overflow.

Hey, this patch is full of a ton of undocumented (and mostly spurious)
whitespace changes, which make it very hard to see the actual patch

> Signed-off-by: Insu Yun <wuninsu@gmail.com>
> ---
>  drivers/scsi/scsi_lib.c | 33 ++++++++++++++++++---------------
>  1 file changed, 18 insertions(+), 15 deletions(-)
[...]
Which is this, I think:

> @@ -2349,6 +2349,9 @@ scsi_mode_select(struct scsi_device *sdev, int
> pf, int sp, int modepage,
>  	unsigned char *real_buffer;
>  	int ret;
>  
> +	if (len < 0)
> +		return -EINVAL;
> +
>  	memset(cmd, 0, sizeof(cmd));
>  	cmd[1] = (pf ? 0x10 : 0) | (sp ? 0x01 : 0);

What's the actual problem here?  There's only one user of
scsi_mode_select: an internal one which always sends in a positive
length, so this check is entirely unnecessary.

James

      reply	other threads:[~2016-01-18 20:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18 19:55 Insu Yun
2016-01-18 20:14 ` James Bottomley [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=1453148090.2363.13.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=changwoo@gatech.edu \
    --cc=insu@gatech.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=taesoo@gatech.edu \
    --cc=wuninsu@gmail.com \
    --cc=yeongjin.jang@gatech.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome