Patch "scsi: hpsa: Fix allocation size for scsi_host_alloc()" has been added to the 5.15-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

    scsi: hpsa: Fix allocation size for scsi_host_alloc()

to the 5.15-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:
     scsi-hpsa-fix-allocation-size-for-scsi_host_alloc.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 8b1e3d90b3f0b2f34757471648b636ec9dde17f0
Author: Alexey V. Vissarionov <gremlin@xxxxxxxxxxxx>
Date:   Wed Jan 18 06:12:55 2023 +0300

    scsi: hpsa: Fix allocation size for scsi_host_alloc()
    
    [ Upstream commit bbbd25499100c810ceaf5193c3cfcab9f7402a33 ]
    
    The 'h' is a pointer to struct ctlr_info, so it's just 4 or 8 bytes, while
    the structure itself is much bigger.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: edd163687ea5 ("hpsa: add driver for HP Smart Array controllers.")
    Link: https://lore.kernel.org/r/20230118031255.GE15213@xxxxxxxxxxxx
    Signed-off-by: Alexey V. Vissarionov <gremlin@xxxxxxxxxxxx>
    Acked-by: Don Brace <don.brace@xxxxxxxxxxxxx>
    Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index cf7988de7b90..8aa5c22ae3ff 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -5848,7 +5848,7 @@ static int hpsa_scsi_host_alloc(struct ctlr_info *h)
 {
 	struct Scsi_Host *sh;
 
-	sh = scsi_host_alloc(&hpsa_driver_template, sizeof(h));
+	sh = scsi_host_alloc(&hpsa_driver_template, sizeof(struct ctlr_info));
 	if (sh == NULL) {
 		dev_err(&h->pdev->dev, "scsi_host_alloc failed\n");
 		return -ENOMEM;



[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