Skip to contentSkip to conversation

scsi: mpi3mr: fix an issue found by KASAN

PATCH Applied Tomas Henzl 3 participants 3 messages Feb 13, 2023 – Feb 22, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: mpi3mr: fix an issue found by KASAN

Write only correct size (32 instead of 64 bytes).

Fixes 42fc9fee116fc ("scsi: mpi3mr: Add helper functions to manage device's port")
---
 drivers/scsi/mpi3mr/mpi3mr_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mpi3mr/mpi3mr_transport.c +1 -1
index 3fc897336b5e..3b61815979da 100644
@@ -1280,7 +1280,7 @@ void mpi3mr_sas_host_add(struct mpi3mr_ioc *mrioc)
 
 	if (mrioc->sas_hba.enclosure_handle) {
 		if (!(mpi3mr_cfg_get_enclosure_pg0(mrioc, &ioc_status,
-		    &encl_pg0, sizeof(dev_pg0),
+		    &encl_pg0, sizeof(encl_pg0),
 		    MPI3_ENCLOS_PGAD_FORM_HANDLE,
 		    mrioc->sas_hba.enclosure_handle)) &&
 		    (ioc_status == MPI3_IOCSTATUS_SUCCESS))
Signature · 1 line
2.39.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Tomas Henzl

Write only correct size (32 instead of 64 bytes).

Fixes 42fc9fee116fc ("scsi: mpi3mr: Add helper functions to manage device's port")

---

Quoted 19 lines
 drivers/scsi/mpi3mr/mpi3mr_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mpi3mr/mpi3mr_transport.c +1 -2
index 3fc897336b5e..3b61815979da 100644
@@ -1280,7 +1280,7 @@ void mpi3mr_sas_host_add(struct mpi3mr_ioc *mrioc)
 
        if (mrioc->sas_hba.enclosure_handle) {
                if (!(mpi3mr_cfg_get_enclosure_pg0(mrioc, &ioc_status,
-                   &encl_pg0, sizeof(dev_pg0),
+                   &encl_pg0, sizeof(encl_pg0),
                    MPI3_ENCLOS_PGAD_FORM_HANDLE,
                    mrioc->sas_hba.enclosure_handle)) &&
                    (ioc_status == MPI3_IOCSTATUS_SUCCESS))
--

2.39.1

Signature · 11 lines
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.
#2 lore raw
In reply to Tomas Henzl

Tomas,

Quoted 1 line

Write only correct size (32 instead of 64 bytes).

Applied to 6.3/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering