mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
SCSI: ibmvscsi: Fix host config length field overflow
commit 225c56960f upstream.
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>
Acked-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
079c1ed89e
commit
a3b1f83195
@@ -1547,6 +1547,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;
|
||||
|
||||
Reference in New Issue
Block a user