]> git.baikalelectronics.ru Git - kernel.git/commit
mvsas: fix panic on expander attached SATA devices
authorJames Bottomley <JBottomley@Odin.com>
Thu, 16 Apr 2015 05:16:01 +0000 (22:16 -0700)
committerJames Bottomley <JBottomley@Odin.com>
Fri, 17 Apr 2015 17:19:07 +0000 (10:19 -0700)
commitdcd385281c731908cfc6869ae028976c552cda3a
tree7555bf5a8f8fa03e0630aeab5ef6ebd1af96595e
parentda0b0f8da549a9e0096d1ff1e80e5cc91f79682c
mvsas: fix panic on expander attached SATA devices

mvsas is giving a General protection fault when it encounters an expander
attached ATA device.  Analysis of mvs_task_prep_ata() shows that the driver is
assuming all ATA devices are locally attached and obtaining the phy mask by
indexing the local phy table (in the HBA structure) with the phy id.  Since
expanders have many more phys than the HBA, this is causing the index into the
HBA phy table to overflow and returning rubbish as the pointer.

mvs_task_prep_ssp() instead does the phy mask using the port properties.
Mirror this in mvs_task_prep_ata() to fix the panic.

Reported-by: Adam Talbot <ajtalbot1@gmail.com>
Tested-by: Adam Talbot <ajtalbot1@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/mvsas/mv_sas.c