]> git.ipfire.org Git - people/arne_f/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)
committerJiri Slaby <jslaby@suse.cz>
Fri, 15 May 2015 07:10:32 +0000 (09:10 +0200)
commite0344d11157175acfc18600b5645a59cc7c3b715
treecc5a139576f930a6157f49793dea7276ebd5bb2d
parentec091a7e9aad7a56e4991c8fe3891fb8c0352d31
mvsas: fix panic on expander attached SATA devices

commit 56cbd0ccc1b508de19561211d7ab9e1c77e6b384 upstream.

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>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/scsi/mvsas/mv_sas.c