]> www.infradead.org Git - users/jedix/linux-maple.git/commit
[SCSI] hpsa: fix potential array overflow in hpsa_update_scsi_devices
authorScott Teel <scott.teel@hp.com>
Wed, 26 Oct 2011 21:21:12 +0000 (16:21 -0500)
committerJoe Jin <joe.jin@oracle.com>
Tue, 15 May 2012 06:47:37 +0000 (14:47 +0800)
commit5665240ecbfe3f92f9412df20dc5183a3c2f9f69
tree06cc2e6aafa485a43ff59efee2df3c0101d44f53
parentb4329e229b950ba8fae5376aa5e71ec6c9d30152
[SCSI] hpsa: fix potential array overflow in hpsa_update_scsi_devices

The currentsd[] array in hpsa_update_scsi_devices had room for
256 devices.  The code was iterating over however many physical
and logical devices plus an additional number of possible external
MSA2XXX controllers, which together could potentially exceed 256.

We increased the size of the currentsd array to 1024 + 1024 + 32 + 1
elements to reflect a reasonable maximum possible number of devices
which might be encountered.  We also don't just walk off the end
of the array if the array controller reports more devices than we
are prepared to handle, we just ignore the excessive devices.

Signed-off-by: Scott Teel <scott.teel@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit b7ec021fe6fe979dbd4e62604a4942f964b12864)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/scsi/hpsa.c
drivers/scsi/hpsa.h
drivers/scsi/hpsa_cmd.h