diff options
author | Alexander Gordeev <agordeev@redhat.com> | 2014-02-19 03:58:18 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-02-21 18:45:26 -0500 |
commit | c5e3035c88cbefe60ec155b3f9999413da1ee694 (patch) | |
tree | 2711267f6bc9e32ef56dc92f19b2992a09b23ea8 | |
parent | f219ad82f8684334524a089c5dd1c47a9c345a91 (diff) |
skd: Fix out of array boundary access
When enabling MSI-X, interrupts are requested for SKD_MAX_MSIX_COUNT
entries in skdev->msix_entries array, while the number of actually
allocated entries is skdev->msix_count. This might lead to an out of
boundary access in case number of allocated entries is less than
SKD_MAX_MSIX_COUNT. This update fixes the described misbehaviour.
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | drivers/block/skd_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index eb6e1e0e8db2..3fa0918ddaf8 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c | |||
@@ -3989,7 +3989,7 @@ static int skd_acquire_msix(struct skd_device *skdev) | |||
3989 | } | 3989 | } |
3990 | 3990 | ||
3991 | /* Enable MSI-X vectors for the base queue */ | 3991 | /* Enable MSI-X vectors for the base queue */ |
3992 | for (i = 0; i < SKD_MAX_MSIX_COUNT; i++) { | 3992 | for (i = 0; i < skdev->msix_count; i++) { |
3993 | qentry = &skdev->msix_entries[i]; | 3993 | qentry = &skdev->msix_entries[i]; |
3994 | snprintf(qentry->isr_name, sizeof(qentry->isr_name), | 3994 | snprintf(qentry->isr_name, sizeof(qentry->isr_name), |
3995 | "%s%d-msix %s", DRV_NAME, skdev->devno, | 3995 | "%s%d-msix %s", DRV_NAME, skdev->devno, |