Skip to content

Commit 225c569

Browse files
ozbenhJames Bottomley
authored andcommitted
[SCSI] ibmvscsi: Fix host config length field overflow
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 <[email protected]> Cc: <[email protected]> Acked-by: Robert Jennings <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent 9965c2f commit 225c569

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/scsi/ibmvscsi/ibmvscsi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,6 +1851,9 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata,
18511851

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

1854+
/* The transport length field is only 16-bit */
1855+
length = min(0xffff, length);
1856+
18541857
/* Set up a lun reset SRP command */
18551858
memset(host_config, 0x00, sizeof(*host_config));
18561859
host_config->common.type = VIOSRP_HOST_CONFIG_TYPE;

0 commit comments

Comments
 (0)