Files
linux/drivers/scsi
Quinn Tran 921d439c67 qla2xxx: Fix stale pointer access.
commit cb43285ff7 upstream.

[ Upstream Commit 84e32a06f4 ]

Commit 84e32a0 ("qla2xxx: Use pci_enable_msix_range() instead of
pci_enable_msix()") introduced a regression when target mode is enabled.
In qla24xx_enable_msix(), ha->max_rsp_queues was incorrectly set
to a value higher than the number of response queues allocated causing
an invalid dereference. Specifically here in qla2x00_init_rings():
    *rsp->in_ptr = 0;

Add additional check to make sure the pointer is valid. following
call stack will be seen

---- 8< ----
RIP: 0010:[<ffffffffa02ccadc>]  [<ffffffffa02ccadc>] qla2x00_init_rings+0xdc/0x320 [qla2xxx]
RSP: 0018:ffff880429447dd8  EFLAGS: 00010082
....
Call Trace:
[<ffffffffa02ceb40>] qla2x00_abort_isp+0x170/0x6b0 [qla2xxx]
[<ffffffffa02c6f77>] qla2x00_do_dpc+0x357/0x7f0 [qla2xxx]
[<ffffffffa02c6c20>] ? qla2x00_relogin+0x260/0x260 [qla2xxx]
[<ffffffff8107d2c9>] kthread+0xc9/0xe0
[<ffffffff8107d200>] ? flush_kthread_worker+0x90/0x90
[<ffffffff8172cc6f>] ret_from_fork+0x3f/0x70
[<ffffffff8107d200>] ? flush_kthread_worker+0x90/0x90
---- 8< ----

Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03 15:07:27 -08:00
..
2015-11-09 16:12:56 -08:00
2015-11-09 17:11:57 -08:00
2015-11-09 17:11:57 -08:00
2015-11-09 17:11:57 -08:00
2015-11-12 07:06:18 -05:00
2015-11-09 17:11:57 -08:00
2015-12-03 09:32:33 -08:00
2015-11-12 07:06:18 -05:00
2015-11-12 07:06:18 -05:00
2015-04-27 10:10:19 -07:00
2015-04-27 10:04:39 -07:00
2015-04-27 10:04:39 -07:00
2015-04-27 10:05:55 -07:00
2015-04-27 10:05:55 -07:00
2015-11-09 17:11:57 -08:00
2015-12-03 09:32:33 -08:00
2015-04-17 10:13:56 -07:00
2014-11-20 09:11:11 +01:00
2015-07-31 13:31:10 +02:00
2014-07-17 22:07:37 +02:00
2014-11-20 09:11:10 +01:00
2014-11-20 09:11:10 +01:00
2015-11-09 17:11:57 -08:00
2014-11-24 16:13:16 +01:00
2015-11-09 16:32:14 -08:00
2014-11-20 09:11:10 +01:00
2015-12-03 09:32:33 -08:00
2015-11-09 12:39:28 -05:00
2015-12-03 09:32:33 -08:00
2015-11-09 12:39:28 -05:00
2015-11-12 07:06:18 -05:00
2015-11-09 19:32:41 -05:00
2015-06-02 17:24:54 -07:00
2015-12-03 09:32:33 -08:00
2014-07-17 22:07:35 +02:00
2014-11-24 20:01:28 +01:00
2014-11-20 09:11:10 +01:00
2014-11-20 09:11:10 +01:00
2015-11-12 07:06:18 -05:00
2015-11-09 17:11:57 -08:00
2014-07-17 22:07:39 +02:00
2016-02-25 12:01:16 -08:00
2014-11-12 11:15:57 +01:00
2015-12-03 09:32:33 -08:00
2015-06-02 08:03:25 -07:00
2015-11-09 17:42:19 -08:00
2014-11-20 09:11:15 +01:00
2014-11-20 09:11:10 +01:00
2014-11-20 09:11:10 +01:00