linux/drivers/nvme/host
Minwoo Im 244a8fe40a nvme-pci: avoid hmb desc array idx out-of-bound when hmmaxd set.
hmb descriptor idx out-of-bound occurs in case of below conditions.
preferred = 128MiB
chunk_size = 4MiB
hmmaxd = 1

Current code will not allow rmmod which will free hmb descriptors
to be done successfully in above case.

"descs[i]" will be set in for-loop without seeing any conditions
related to "max_entries" after a single "descs" was allocated by
(max_entries = 1) in this case.

Added a condition into for-loop to check index of descriptors.

Fixes: 044a9df1("nvme-pci: implement the HMB entry number and size limitations")
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2017-11-20 08:38:09 +01:00
..
core.c Merge branch 'for-4.15/block' of git://git.kernel.dk/linux-block 2017-11-14 15:32:19 -08:00
fabrics.c nvme: track subsystems 2017-11-10 19:53:25 -07:00
fabrics.h nvme-fabrics: introduce init command check for a queue that is not alive 2017-11-20 08:28:31 +01:00
fc.c nvme-fc: check if queue is ready in queue_rq 2017-11-20 08:28:35 +01:00
Kconfig nvme: implement multipath access to nvme subsystems 2017-11-10 19:53:25 -07:00
lightnvm.c nvme: track shared namespaces 2017-11-10 19:53:25 -07:00
Makefile Merge branch 'for-4.15/block' of git://git.kernel.dk/linux-block 2017-11-14 15:32:19 -08:00
multipath.c nvme: create 'slaves' and 'holders' entries for hidden controllers 2017-11-10 19:53:25 -07:00
nvme.h nvme: create 'slaves' and 'holders' entries for hidden controllers 2017-11-10 19:53:25 -07:00
pci.c nvme-pci: avoid hmb desc array idx out-of-bound when hmmaxd set. 2017-11-20 08:38:09 +01:00
rdma.c nvme-fabrics: introduce init command check for a queue that is not alive 2017-11-20 08:28:31 +01:00