Patch "nvme-fc: Prevent null pointer dereference in nvme_fc_io_getuuid()" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    nvme-fc: Prevent null pointer dereference in nvme_fc_io_getuuid()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nvme-fc-prevent-null-pointer-dereference-in-nvme_fc_.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit eb02931163862f214b54479f7b0fb4a577a139d1
Author: Nigel Kirkland <nkirkland2304@xxxxxxxxx>
Date:   Thu Aug 17 12:43:01 2023 -0700

    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@xxxxxxxxx>
    Reviewed-by: James Smart <jsmart2021@xxxxxxxxx>
    Signed-off-by: Keith Busch <kbusch@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 6c3d469eed7e3..177a365b8ec55 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -1911,7 +1911,7 @@ char *nvme_fc_io_getuuid(struct nvmefc_fcp_req *req)
 	struct nvme_fc_fcp_op *op = fcp_req_to_fcp_op(req);
 	struct request *rq = op->rq;
 
-	if (!IS_ENABLED(CONFIG_BLK_CGROUP_FC_APPID) || !rq->bio)
+	if (!IS_ENABLED(CONFIG_BLK_CGROUP_FC_APPID) || !rq || !rq->bio)
 		return NULL;
 	return blkcg_get_fc_appid(rq->bio);
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux