linux-stable/drivers/scsi/megaraid
Sumit.Saxena@avagotech.com 90dc9d98f0 megaraid_sas : MFI MPT linked list corruption fix
Resending the patch. Addressed the review comments from Tomas Henzl.
Added comment for to-do work.

Problem statement:
MFI link list in megaraid_sas driver is used from mfi-mpt pass-through commands.
This list can be corrupted due to many possible race conditions in driver and
eventually we may see kernel panic.

One example -
MFI frame is freed from calling process as driver send command via polling method and interrupt
for that command comes after driver free mfi frame (actually even after some other context reuse
the mfi frame). When driver receive MPT frame in ISR, driver will be using the index of MFI and
access that MFI frame and finally in-used MFI frame’s list will be corrupted.

High level description of new solution -
Free MFI and MPT command from same context.
Free both the command either from process (from where mfi-mpt pass-through was called) or from
ISR context. Do not split freeing of MFI and MPT, because it creates the race condition which
will do MFI/MPT list corruption.

Renamed the cmd_pool_lock which is used in instance as well as fusion with below name.
mfi_pool_lock and mpt_pool_lock to add more code readability.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-16 09:19:28 -07:00
..
Kconfig.megaraid
Makefile
mbox_defs.h
mega_common.h scsi: use 64-bit LUNs 2014-07-17 22:07:37 +02:00
megaraid_ioctl.h
megaraid_mbox.c scsi: use pci_zalloc_consistent 2014-08-08 15:57:29 -07:00
megaraid_mbox.h
megaraid_mm.c [SCSI] megaraid: missing bounds check in mimd_to_kioc() 2014-03-15 10:19:00 -07:00
megaraid_mm.h
megaraid_sas.h megaraid_sas : MFI MPT linked list corruption fix 2014-09-16 09:19:28 -07:00
megaraid_sas_base.c megaraid_sas : MFI MPT linked list corruption fix 2014-09-16 09:19:28 -07:00
megaraid_sas_fp.c megaraid_sas : N-drive primary raid level 1 load balancing 2014-09-16 09:14:26 -07:00
megaraid_sas_fusion.c megaraid_sas : MFI MPT linked list corruption fix 2014-09-16 09:19:28 -07:00
megaraid_sas_fusion.h megaraid_sas : MFI MPT linked list corruption fix 2014-09-16 09:19:28 -07:00