linux/drivers/scsi/be2iscsi
Jayamohan Kallickal 8fc01eaa87 be2iscsi: Fix memory corruption in MBX path
From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
 Sent: Friday, March 28, 2014 1:42 AM
 Subject: re: [SCSI] be2iscsi: Fix handling timed out MBX completion from FW

 Hello Jayamohan Kallickal,

 The patch 1957aa7f62: "[SCSI] be2iscsi: Fix handling timed out MBX completion from FW" from Jan 29, 2014, leads to the following static checker warning:

 drivers/scsi/be2iscsi/be_main.c:5581 beiscsi_dev_probe()
 error: memset() '&phba->ctrl.ptag_state[i]->tag_mem_state' too small (24 vs 32)

 drivers/scsi/be2iscsi/be_main.c
 5576          for (i = 0; i < MAX_MCC_CMD; i++) {
 5577                  init_waitqueue_head(&phba->ctrl.mcc_wait[i + 1]);
 5578                  phba->ctrl.mcc_tag[i] = i + 1;
 5579                  phba->ctrl.mcc_numtag[i + 1] = 0;
 5580                  phba->ctrl.mcc_tag_available++;
 5581                  memset(&phba->ctrl.ptag_state[i].tag_mem_state, 0,
 5582                         sizeof(struct beiscsi_mcc_tag_state));
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 Probably this this be change to sizeof(struct be_dma_mem struct)?  It looks like we are corrupting memory a bit here.

 5583          }

 regards,
 dan carpenter

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-05-28 18:13:16 +02:00
..
be_cmds.c [SCSI] be2iscsi: Fix the session cleanup when reboot/shutdown happens 2014-03-15 10:19:11 -07:00
be_cmds.h be2iscsi: Fix TCP parameters while connection offloading. 2014-05-28 18:13:15 +02:00
be_iscsi.c be2iscsi: Fix TCP parameters while connection offloading. 2014-05-28 18:13:15 +02:00
be_iscsi.h [SCSI] be2scsi: Update copyright dates to 2013 2013-05-02 08:16:45 -07:00
be_main.c be2iscsi: Fix memory corruption in MBX path 2014-05-28 18:13:16 +02:00
be_main.h be2iscsi: Fix interrupt Coalescing mechanism. 2014-05-28 18:13:15 +02:00
be_mgmt.c be2iscsi: Fix TCP parameters while connection offloading. 2014-05-28 18:13:15 +02:00
be_mgmt.h be2iscsi: Fix interrupt Coalescing mechanism. 2014-05-28 18:13:15 +02:00
be.h be2iscsi: Fix interrupt Coalescing mechanism. 2014-05-28 18:13:15 +02:00
Kconfig [SCSI] be2iscsi: select ISCSI_BOOT_SYSFS 2010-08-06 09:41:59 -05:00
Makefile