From 8ed7f4bbc19bc77c49c6e76f62d579e2a63c550b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 6 Apr 2019 23:17:27 +0000 Subject: [PATCH] qla2x00t-32gbit: Add a runtime array bounds check Complain if the msix_entries[] array is accessed outside its bounds. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8164 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_isr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qla2x00t-32gbit/qla_isr.c b/qla2x00t-32gbit/qla_isr.c index 7099ede9d..2896dc198 100644 --- a/qla2x00t-32gbit/qla_isr.c +++ b/qla2x00t-32gbit/qla_isr.c @@ -3614,6 +3614,7 @@ msix_failed: /* Enable MSI-X vectors for the base queue */ for (i = 0; i < QLA_BASE_VECTORS; i++) { + WARN(i >= ha->msix_count, "%d > %d\n", i, ha->msix_count); qentry = &ha->msix_entries[i]; qentry->handle = rsp; rsp->msix = qentry; @@ -3639,6 +3640,8 @@ msix_failed: */ if (QLA_TGT_MODE_ENABLED() && (ql2xenablemsix != 0) && IS_ATIO_MSIX_CAPABLE(ha)) { + WARN(QLA_ATIO_VECTOR >= ha->msix_count, "%d > %d\n", + QLA_ATIO_VECTOR, ha->msix_count); qentry = &ha->msix_entries[QLA_ATIO_VECTOR]; rsp->msix = qentry; qentry->handle = rsp;