kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] megaraid_sas: harmless memory corruption in megasas_mgmt_fw_ioctl()
@ 2015-02-25 13:22 Dan Carpenter
  2015-02-25 13:58 ` Sumit Saxena
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-02-25 13:22 UTC (permalink / raw)
  To: Kashyap Desai
  Cc: Sumit Saxena, Uday Lingala, James E.J. Bottomley,
	megaraidlinux.pdl, linux-scsi, kernel-janitors

The intent here was for the "kbuff_arr[i] = NULL;" to be inside the
loop but, because the curly braces were missing, it's after the loop.
This means we corrupt a little memory one step beyond the array.
Fortunately, we weren't going to use that memory anyway so it's
harmless.  Also we aren't going to use kbuff_arr[] again so we don't
need to set it to NULL.

I have deleted that line of code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 890637f..834bfc0 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -6208,7 +6208,6 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
 					  le32_to_cpu(kern_sge32[i].length),
 					  kbuff_arr[i],
 					  le32_to_cpu(kern_sge32[i].phys_addr));
-			kbuff_arr[i] = NULL;
 	}
 
 	if (instance->ctrl_context && cmd->mpt_pthr_cmd_blocked)

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

* RE: [patch] megaraid_sas: harmless memory corruption in megasas_mgmt_fw_ioctl()
  2015-02-25 13:22 [patch] megaraid_sas: harmless memory corruption in megasas_mgmt_fw_ioctl() Dan Carpenter
@ 2015-02-25 13:58 ` Sumit Saxena
  0 siblings, 0 replies; 2+ messages in thread
From: Sumit Saxena @ 2015-02-25 13:58 UTC (permalink / raw)
  To: Dan Carpenter, Kashyap Desai
  Cc: Uday Lingala, James E.J. Bottomley, PDL,MEGARAIDLINUX, linux-scsi,
	kernel-janitors

>-----Original Message-----
>From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
>Sent: Wednesday, February 25, 2015 6:53 PM
>To: Kashyap Desai
>Cc: Sumit Saxena; Uday Lingala; James E.J. Bottomley;
>megaraidlinux.pdl@avagotech.com; linux-scsi@vger.kernel.org; kernel-
>janitors@vger.kernel.org
>Subject: [patch] megaraid_sas: harmless memory corruption in
>megasas_mgmt_fw_ioctl()
>
>The intent here was for the "kbuff_arr[i] = NULL;" to be inside the loop
but,
>because the curly braces were missing, it's after the loop.
>This means we corrupt a little memory one step beyond the array.
>Fortunately, we weren't going to use that memory anyway so it's harmless.
>Also we aren't going to use kbuff_arr[] again so we don't need to set it
to
>NULL.
>
>I have deleted that line of code.
>
>Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
>diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
>b/drivers/scsi/megaraid/megaraid_sas_base.c
>index 890637f..834bfc0 100644
>--- a/drivers/scsi/megaraid/megaraid_sas_base.c
>+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
>@@ -6208,7 +6208,6 @@ megasas_mgmt_fw_ioctl(struct megasas_instance
>*instance,
>
le32_to_cpu(kern_sge32[i].length),
> 					  kbuff_arr[i],
>
>le32_to_cpu(kern_sge32[i].phys_addr));
>-			kbuff_arr[i] = NULL;
> 	}
>
> 	if (instance->ctrl_context && cmd->mpt_pthr_cmd_blocked)

Acked-by: Sumit Saxena <sumit.saxena@avagotech.com>

-Sumit

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

end of thread, other threads:[~2015-02-25 13:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25 13:22 [patch] megaraid_sas: harmless memory corruption in megasas_mgmt_fw_ioctl() Dan Carpenter
2015-02-25 13:58 ` Sumit Saxena

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).