All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: hpsa: Fix allocation size for Scsi_Host private data
@ 2024-03-12 17:04 Yuri Karpov
  2024-05-07  1:59 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Yuri Karpov @ 2024-03-12 17:04 UTC (permalink / raw)
  To: Don Brace
  Cc: Yuri Karpov, James E.J. Bottomley, Martin K. Petersen,
	Alexey V. Vissarionov, storagedev, linux-scsi, linux-kernel,
	lvc-project

struct Scsi_Host private data contains pointer to struct ctlr_info.

Restore allocation of only 8 bytes to store pointer in struct Scsi_Host
 private data area.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: bbbd25499100 ("scsi: hpsa: Fix allocation size for scsi_host_alloc()")
Signed-off-by: Yuri Karpov <YKarpov@ispras.ru>
---
 drivers/scsi/hpsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index af18d20f3079..4ad32de61bb8 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -5850,7 +5850,7 @@ static int hpsa_scsi_host_alloc(struct ctlr_info *h)
 {
 	struct Scsi_Host *sh;
 
-	sh = scsi_host_alloc(&hpsa_driver_template, sizeof(struct ctlr_info));
+	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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: hpsa: Fix allocation size for Scsi_Host private data
  2024-03-12 17:04 [PATCH] scsi: hpsa: Fix allocation size for Scsi_Host private data Yuri Karpov
@ 2024-05-07  1:59 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2024-05-07  1:59 UTC (permalink / raw)
  To: Don Brace, Yuri Karpov
  Cc: Martin K . Petersen, James E.J. Bottomley, Alexey V. Vissarionov,
	storagedev, linux-scsi, linux-kernel, lvc-project

On Tue, 12 Mar 2024 20:04:47 +0300, Yuri Karpov wrote:

> struct Scsi_Host private data contains pointer to struct ctlr_info.
> 
> Restore allocation of only 8 bytes to store pointer in struct Scsi_Host
>  private data area.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> [...]

Applied to 6.10/scsi-queue, thanks!

[1/1] scsi: hpsa: Fix allocation size for Scsi_Host private data
      https://git.kernel.org/mkp/scsi/c/504e2bed5d50

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-07  2:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-12 17:04 [PATCH] scsi: hpsa: Fix allocation size for Scsi_Host private data Yuri Karpov
2024-05-07  1:59 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.