Skip to content

Commit

Permalink
[SCSI] ibmvscsi: Fix host config length field overflow
Browse files Browse the repository at this point in the history
The length field in the host config packet is only 16-bit long, so
passing it 0x10000 (64K which is our standard PAGE_SIZE) doesn't
work and result in an empty config from the server.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: <stable@vger.kernel.org>
Acked-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Benjamin Herrenschmidt authored and James Bottomley committed Sep 24, 2012
1 parent 9965c2f commit 225c569
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/scsi/ibmvscsi/ibmvscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,9 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata,

host_config = &evt_struct->iu.mad.host_config;

/* The transport length field is only 16-bit */
length = min(0xffff, length);

/* Set up a lun reset SRP command */
memset(host_config, 0x00, sizeof(*host_config));
host_config->common.type = VIOSRP_HOST_CONFIG_TYPE;
Expand Down

0 comments on commit 225c569

Please sign in to comment.