diff options
author | Scott Teel <scott.teel@hp.com> | 2011-10-26 17:21:12 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-10-30 06:34:04 -0400 |
commit | b7ec021fe6fe979dbd4e62604a4942f964b12864 (patch) | |
tree | 1fb695d21736aa12d6144fcd373aee9fe1b6dc54 /drivers/scsi/hpsa_cmd.h | |
parent | cfe5badcab2e993e71ebebbc07c21c270e5580c0 (diff) |
[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>
Diffstat (limited to 'drivers/scsi/hpsa_cmd.h')
-rw-r--r-- | drivers/scsi/hpsa_cmd.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h index 55d741b019db..3fd4715935c2 100644 --- a/drivers/scsi/hpsa_cmd.h +++ b/drivers/scsi/hpsa_cmd.h | |||
@@ -123,8 +123,11 @@ union u64bit { | |||
123 | 123 | ||
124 | /* FIXME this is a per controller value (barf!) */ | 124 | /* FIXME this is a per controller value (barf!) */ |
125 | #define HPSA_MAX_TARGETS_PER_CTLR 16 | 125 | #define HPSA_MAX_TARGETS_PER_CTLR 16 |
126 | #define HPSA_MAX_LUN 256 | 126 | #define HPSA_MAX_LUN 1024 |
127 | #define HPSA_MAX_PHYS_LUN 1024 | 127 | #define HPSA_MAX_PHYS_LUN 1024 |
128 | #define MAX_MSA2XXX_ENCLOSURES 32 | ||
129 | #define HPSA_MAX_DEVICES (HPSA_MAX_PHYS_LUN + HPSA_MAX_LUN + \ | ||
130 | MAX_MSA2XXX_ENCLOSURES + 1) /* + 1 is for the controller itself */ | ||
128 | 131 | ||
129 | /* SCSI-3 Commands */ | 132 | /* SCSI-3 Commands */ |
130 | #pragma pack(1) | 133 | #pragma pack(1) |