• Kashyap, Desai's avatar
    [SCSI] mpt2sas: Added sanity check for cb_idx and smid access. · dd3741d3
    Kashyap, Desai authored
    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: default avatarKashyap Desai <kashyap.desai@lsi.com>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
    dd3741d3
mpt2sas_base.c 111 KB