[lkml]   [2020]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] scsi: mvsas: ensure loop counter phy_no does not wrap and cause an infinite loop
On Sun, 2020-01-26 at 15:17 +0000, Colin King wrote:
> From: Colin Ian King <>
> 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.


 \ /
  Last update: 2020-01-26 17:19    [W:0.038 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site