]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] mpt2sas: Added sanity check for cb_idx and smid access.
authorKashyap, Desai <kashyap.desai@lsi.com>
Fri, 12 Nov 2010 23:01:14 +0000 (04:31 +0530)
committerJames Bottomley <James.Bottomley@suse.de>
Tue, 21 Dec 2010 18:24:03 +0000 (12:24 -0600)
commita2b97d07b1a1441a2c8c19c551394da80366af5f
tree948c762c9b1131ce0dd7d7eb8879d4c607908a58
parent9023029be3799e36f1143ffb3fc0271e9dfec7b5
[SCSI] mpt2sas: Added sanity check for cb_idx and smid access.

Sometime it is seen that controller
firmware returns an invalid system message id (smid).

the oops is occurring becuase mpt_callbacks pointer is referenced to
either null or invalid virtual address.  this is due to cb_idx set
incorrectly from routine _base_get_cb_idx.  the cb_idx was set incorrectly
becuase there is no check to make sure smid is less than maxiumum
anticapted smid.   to fix this issue, we add a check in
_base_get_cb_idx to make sure smid is not greater than
ioc->hba_queue_depth.   in addition, a similar check was added to make
sure the reply address was less than the largest anticapated address.

Newer firmware has sovled this issue, however it good to have this sanity
check.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/mpt2sas/mpt2sas_base.c
drivers/scsi/mpt2sas/mpt2sas_base.h