linux-stable/drivers/nvme
Smith, Kyle Miller (Nimble Kernel) f767296626 nvme-pci: fix a NULL pointer dereference in nvme_alloc_admin_tags
[ Upstream commit da42761181 ]

In nvme_alloc_admin_tags, the admin_q can be set to an error (typically
-ENOMEM) if the blk_mq_init_queue call fails to set up the queue, which
is checked immediately after the call. However, when we return the error
message up the stack, to nvme_reset_work the error takes us to
nvme_remove_dead_ctrl()
  nvme_dev_disable()
   nvme_suspend_queue(&dev->queues[0]).

Here, we only check that the admin_q is non-NULL, rather than not
an error or NULL, and begin quiescing a queue that never existed, leading
to bad / NULL pointer dereference.

Signed-off-by: Kyle Smith <kyles@hpe.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-14 18:11:28 +02:00
..
host nvme-pci: fix a NULL pointer dereference in nvme_alloc_admin_tags 2022-06-14 18:11:28 +02:00
target nvmet: use IOCB_NOWAIT only if the filesystem supports it 2021-12-01 09:23:33 +01:00
Kconfig
Makefile