* [PATCH] scsi: 53c700: Fix hostdata[] size on 64-bit
@ 2026-11-23 8:57 Geert Uytterhoeven
2026-11-26 2:48 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2026-11-23 8:57 UTC (permalink / raw)
To: James E . J . Bottomley, Martin K . Petersen, Kars de Jong
Cc: linux-scsi, linux-parisc, linux-alpha, Geert Uytterhoeven
From: Geert Uytterhoeven <geert@linux-m68k.org>
NCR_700_detect() allocates four bytes for a single-entry hostdata array,
to store the NCR_700_Host_Parameters pointer. However, hostdata is an
array of unsigned longs, thus storing a pointer or unsigned long causes
a buffer overflow on 64-bit platforms.
Fixes: 1da177e4c3f41524 ("Linux-2.6.12-rc2")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Compile-tested only.
CONFIG_SCSI_LASI700 is used on PA-RISC 64-bit,
CONFIG_SCSI_SIM710 might be used on Alpha with EISA.
---
drivers/scsi/53c700.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index eb3a69dff1e72642..7236f9bfa0fe302f 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -341,7 +341,7 @@ NCR_700_detect(struct scsi_host_template *tpnt,
if(tpnt->proc_name == NULL)
tpnt->proc_name = "53c700";
- host = scsi_host_alloc(tpnt, 4);
+ host = scsi_host_alloc(tpnt, sizeof(unsigned long));
if (!host)
return NULL;
memset(hostdata->slots, 0, sizeof(struct NCR_700_command_slot)
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] scsi: 53c700: Fix hostdata[] size on 64-bit
2026-11-23 8:57 [PATCH] scsi: 53c700: Fix hostdata[] size on 64-bit Geert Uytterhoeven
@ 2026-11-26 2:48 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2026-11-26 2:48 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: James E . J . Bottomley, Martin K . Petersen, Kars de Jong,
linux-scsi, linux-parisc, linux-alpha, Geert Uytterhoeven
Geert,
> NCR_700_detect() allocates four bytes for a single-entry hostdata
> array, to store the NCR_700_Host_Parameters pointer. However, hostdata
> is an array of unsigned longs, thus storing a pointer or unsigned long
> causes a buffer overflow on 64-bit platforms.
Applied to 7.5/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-26 2:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 8:57 [PATCH] scsi: 53c700: Fix hostdata[] size on 64-bit Geert Uytterhoeven
2026-11-26 2:48 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox