All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <jejb@linux.ibm.com>
To: Colin King <colin.king@canonical.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: mvsas: ensure loop counter phy_no  does not wrap and cause an infinite loop
Date: Sun, 26 Jan 2020 16:18:24 +0000	[thread overview]
Message-ID: <1580055504.4964.2.camel@linux.ibm.com> (raw)
In-Reply-To: <20200126151747.33320-1-colin.king@canonical.com>

On Sun, 2020-01-26 at 15:17 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The loop counter phy_no is a u8 where as the upper limit of the loop
> is a u32. In the event that upper limit is greater than 255 we end
> up with an infinite loop since phy_no will wrap around an never reach
> upper loop limit. Fix this by making phy_no a u32.

This value is limited to MVS_MAX_PHYS (i.e. 8) so I don't see where the
concern comes from.  If we were ever to overrun that, we'd corrupt the
chip info structure, because it only allows MVS_MAX_PHYS for the amount
of space.

James

WARNING: multiple messages have this Message-ID (diff)
From: James Bottomley <jejb@linux.ibm.com>
To: Colin King <colin.king@canonical.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: mvsas: ensure loop counter phy_no  does not wrap and cause an infinite loop
Date: Sun, 26 Jan 2020 08:18:24 -0800	[thread overview]
Message-ID: <1580055504.4964.2.camel@linux.ibm.com> (raw)
In-Reply-To: <20200126151747.33320-1-colin.king@canonical.com>

On Sun, 2020-01-26 at 15:17 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The loop counter phy_no is a u8 where as the upper limit of the loop
> is a u32. In the event that upper limit is greater than 255 we end
> up with an infinite loop since phy_no will wrap around an never reach
> upper loop limit. Fix this by making phy_no a u32.

This value is limited to MVS_MAX_PHYS (i.e. 8) so I don't see where the
concern comes from.  If we were ever to overrun that, we'd corrupt the
chip info structure, because it only allows MVS_MAX_PHYS for the amount
of space.

James


  reply	other threads:[~2020-01-26 16:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-26 15:17 [PATCH] scsi: mvsas: ensure loop counter phy_no does not wrap and cause an infinite loop Colin King
2020-01-26 15:17 ` Colin King
2020-01-26 16:18 ` James Bottomley [this message]
2020-01-26 16:18   ` James Bottomley

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=1580055504.4964.2.camel@linux.ibm.com \
    --to=jejb@linux.ibm.com \
    --cc=colin.king@canonical.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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.