From b7ec021fe6fe979dbd4e62604a4942f964b12864 Mon Sep 17 00:00:00 2001 From: Scott Teel Date: Wed, 26 Oct 2011 16:21:12 -0500 Subject: [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 Signed-off-by: Stephen M. Cameron Signed-off-by: James Bottomley --- drivers/scsi/hpsa.h | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/scsi/hpsa.h') diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h index 4de9f71d8bff..73858bc22e57 100644 --- a/drivers/scsi/hpsa.h +++ b/drivers/scsi/hpsa.h @@ -102,7 +102,6 @@ struct ctlr_info { struct Scsi_Host *scsi_host; spinlock_t devlock; /* to protect hba[ctlr]->dev[]; */ int ndevices; /* number of used elements in .dev[] array. */ -#define HPSA_MAX_DEVICES 256 struct hpsa_scsi_dev_t *dev[HPSA_MAX_DEVICES]; /* * Performant mode tables. -- cgit v1.2.3