diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-02-14 19:38:55 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-02-15 21:37:35 -0500 |
commit | 40a4c2c392593b57a2e6f6438794492596279838 (patch) | |
tree | e286b7a6581d7e4af086f100e1dcb99e79eda92a /drivers/scsi/megaraid/megaraid_sas_base.c | |
parent | 8e305cb2bd8b6300ea29420f2458a2f245bdacbd (diff) | |
download | blackbird-op-linux-40a4c2c392593b57a2e6f6438794492596279838.tar.gz blackbird-op-linux-40a4c2c392593b57a2e6f6438794492596279838.zip |
scsi: megaraid_sas: array overflow in megasas_dump_frame()
The "sz" variable is in terms of bytes, but we're treating the buffer as
an array of __le32 so we have to divide by 4.
Fixes: def0eab3af86 ("scsi: megaraid_sas: enhance debug logs in OCR context")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_sas_base.c')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index dc9f42e135bb..7ac9a9ee9bd4 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -2754,7 +2754,7 @@ megasas_dump_frame(void *mpi_request, int sz) __le32 *mfp = (__le32 *)mpi_request; printk(KERN_INFO "IO request frame:\n\t"); - for (i = 0; i < sz; i++) { + for (i = 0; i < sz / sizeof(__le32); i++) { if (i && ((i % 8) == 0)) printk("\n\t"); printk("%08x ", le32_to_cpu(mfp[i])); |