Skip to contentSkip to conversation

scsi: megasas: initialise local configuration data buffer

PATCH In review P J P 2 participants 4 messages May 25, 2016 – Jun 7, 2016

lore
Share & tools
lore

P J P

author
#0 lore raw

PATCH v2 1/1 scsi: megasas: initialise local configuration data buffer

From: Prasad J Pandit <[email protected]>

When reading MegaRAID SAS controller configuration via MegaRAID Firmware Interface(MFI) commands, routine megasas_dcmd_cfg_read uses an uninitialised local data buffer. Initialise this buffer to avoid stack information leakage.

---
 hw/scsi/megasas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Update as per
-> https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg04402.html

hw/scsi/megasas.c +1 -1
index dcbd3e1..bf642d4 100644
@@ -1293,7 +1293,7 @@ static int megasas_dcmd_ld_get_info(MegasasState *s, MegasasCmd *cmd)
 
 static int megasas_dcmd_cfg_read(MegasasState *s, MegasasCmd *cmd)
 {
-    uint8_t data[4096];
+    uint8_t data[4096] = { 0 };
     struct mfi_config_data *info;
     int num_pd_disks = 0, array_offset, ld_offset;
     BusChild *kid;
Signature · 1 line
2.5.5
author
#1 lore raw
+-- On Wed, 25 May 2016, P J P wrote --+
| Update as per
|   -> https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg04402.html
| 
| diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
| index dcbd3e1..bf642d4 100644
| --- a/hw/scsi/megasas.c
| +++ b/hw/scsi/megasas.c
| @@ -1293,7 +1293,7 @@ static int megasas_dcmd_ld_get_info(MegasasState *s, MegasasCmd *cmd)
|  
|  static int megasas_dcmd_cfg_read(MegasasState *s, MegasasCmd *cmd)
|  {
| -    uint8_t data[4096];
| +    uint8_t data[4096] = { 0 };
|      struct mfi_config_data *info;
|      int num_pd_disks = 0, array_offset, ld_offset;
|      BusChild *kid;

Ping..!

This one came with couple of others,

-> https://patchwork.ozlabs.org/patch/626089/
-> https://patchwork.ozlabs.org/patch/626152/
-> https://patchwork.ozlabs.org/patch/626151/

Are these queued? (just checking)

Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F

#2 lore raw
Quoted 20 lines · P J P
+-- On Wed, 25 May 2016, P J P wrote --+
| Update as per
|   -> https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg04402.html
| 
| diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
| index dcbd3e1..bf642d4 100644
| --- a/hw/scsi/megasas.c
| +++ b/hw/scsi/megasas.c
| @@ -1293,7 +1293,7 @@ static int megasas_dcmd_ld_get_info(MegasasState *s, MegasasCmd *cmd)
|  
|  static int megasas_dcmd_cfg_read(MegasasState *s, MegasasCmd *cmd)
|  {
| -    uint8_t data[4096];
| +    uint8_t data[4096] = { 0 };
|      struct mfi_config_data *info;
|      int num_pd_disks = 0, array_offset, ld_offset;
|      BusChild *kid;

Ping..!

Quoted 7 lines

This one came with couple of others,

-> https://patchwork.ozlabs.org/patch/626089/
-> https://patchwork.ozlabs.org/patch/626152/
-> https://patchwork.ozlabs.org/patch/626151/

Are these queued? (just checking)

They are in already. In particular this is commit d37af740730dbbb93960cd318e040372d04d6dcf.

Paolo

author
#3 lore raw
+-- On Tue, 7 Jun 2016, Paolo Bonzini wrote --+
| They are in already.  In particular this is commit
| d37af740730dbbb93960cd318e040372d04d6dcf.

Okay, thank you. (sorry to bother you)
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F