nvme-fc: Prevent null pointer dereference in nvme_fc_io_getuuid()
authorNigel Kirkland <nkirkland2304@gmail.com>
Thu, 17 Aug 2023 19:43:01 +0000 (12:43 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2023 12:56:51 +0000 (14:56 +0200)
commitbe90c9e29dd59b7d19a73297a1590ff3ec1d22ea
treee576fafc05f28dd10317f9341bdfd951844e63a7
parent36b29974a7ad2ff604c24ad348f940506c7b1209
nvme-fc: Prevent null pointer dereference in nvme_fc_io_getuuid()

[ Upstream commit 8ae5b3a685dc59a8cf7ccfe0e850999ba9727a3c ]

The nvme_fc_fcp_op structure describing an AEN operation is initialized with a
null request structure pointer. An FC LLDD may make a call to
nvme_fc_io_getuuid passing a pointer to an nvmefc_fcp_req for an AEN operation.

Add validation of the request structure pointer before dereference.

Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com>
Reviewed-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/fc.c