public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: mpi3mr: fix an issue found by KASAN
@ 2023-02-13 19:37 Tomas Henzl
  2023-02-13 19:40 ` Sathya Prakash Veerichetty
  2023-02-22  0:50 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Tomas Henzl @ 2023-02-13 19:37 UTC (permalink / raw)
  To: linux-scsi; +Cc: sreekanth.reddy, sathya.prakash

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

Fixes: 42fc9fee116fc ("scsi: mpi3mr: Add helper functions to manage device's port")
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
---
 drivers/scsi/mpi3mr/mpi3mr_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c
index 3fc897336b5e..3b61815979da 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_transport.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c
@@ -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


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

* Re: [PATCH] scsi: mpi3mr: fix an issue found by KASAN
  2023-02-13 19:37 [PATCH] scsi: mpi3mr: fix an issue found by KASAN Tomas Henzl
@ 2023-02-13 19:40 ` Sathya Prakash Veerichetty
  2023-02-22  0:50 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Sathya Prakash Veerichetty @ 2023-02-13 19:40 UTC (permalink / raw)
  To: Tomas Henzl; +Cc: linux-scsi, sreekanth.reddy

[-- Attachment #1: Type: text/plain, Size: 1942 bytes --]

On Mon, Feb 13, 2023 at 12:37 PM Tomas Henzl <thenzl@redhat.com> wrote:
>
> Write only correct size (32 instead of 64 bytes).
>
> Fixes: 42fc9fee116fc ("scsi: mpi3mr: Add helper functions to manage device's port")
> Signed-off-by: Tomas Henzl <thenzl@redhat.com>
> ---
Acked-by: Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>
>  drivers/scsi/mpi3mr/mpi3mr_transport.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c
> index 3fc897336b5e..3b61815979da 100644
> --- a/drivers/scsi/mpi3mr/mpi3mr_transport.c
> +++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c
> @@ -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
>

-- 
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.

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4227 bytes --]

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

* Re: [PATCH] scsi: mpi3mr: fix an issue found by KASAN
  2023-02-13 19:37 [PATCH] scsi: mpi3mr: fix an issue found by KASAN Tomas Henzl
  2023-02-13 19:40 ` Sathya Prakash Veerichetty
@ 2023-02-22  0:50 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2023-02-22  0:50 UTC (permalink / raw)
  To: Tomas Henzl; +Cc: linux-scsi, sreekanth.reddy, sathya.prakash


Tomas,

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

Applied to 6.3/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2023-02-22  0:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-13 19:37 [PATCH] scsi: mpi3mr: fix an issue found by KASAN Tomas Henzl
2023-02-13 19:40 ` Sathya Prakash Veerichetty
2023-02-22  0:50 ` 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