]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: mpt3sas: Fix memset() in non-RDPQ mode
authorSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
Thu, 28 May 2020 14:56:17 +0000 (10:56 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 3 Jun 2020 01:39:31 +0000 (21:39 -0400)
commit90d065a97abb6830e250f77e4c3aed299180ac3f
tree9ed277da9d9d794656316074b926d3d482585c5f
parentaa405f31299c7a8be38cbd0263a3219d664ba4a8
scsi: mpt3sas: Fix memset() in non-RDPQ mode

Fix memset() accessing out of range address when reply_queue count is less
than RDPQ_MAX_INDEX_IN_ONE_CHUNK (i.e. 16) in non-RDPQ mode.

In non-RDPQ mode, the driver allocates a single contiguous pool of size
reply_queue's count * reqly_post_free_sz. But the driver is always
memsetting this pool with size 16 * reqly_post_free_sz. If reply queue
count is less than 16 (i.e. when MSI-X vectors enabled < 16), the driver is
accessing out of range address and this results in 'BUG: unable to handle
kernel paging request at fff0x...x' bug.

Make driver use dma_pool_zalloc() API to allocate and zero the pool.

Link: https://lore.kernel.org/r/20200528145617.27252-1-suganath-prabu.subramani@broadcom.com
Fixes: f3372721cd89 ("scsi: mpt3sas: Handle RDPQ DMA allocation in same 4G region")
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_base.c