diff options
author | Andrew Vasquez <andrewv@marvell.com> | 2019-04-02 14:24:25 -0700 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-09-23 21:11:37 +0100 |
commit | 0166dc4aae7eb4c2faf709a989260214edc9b388 (patch) | |
tree | 570484b330e73b26909a5e1c5edf5cbaccb4d87f /drivers/scsi | |
parent | b4795ca5f5d01433dbb4be03179e4605178bc12a (diff) | |
download | linux-stable-0166dc4aae7eb4c2faf709a989260214edc9b388.tar.gz linux-stable-0166dc4aae7eb4c2faf709a989260214edc9b388.tar.bz2 linux-stable-0166dc4aae7eb4c2faf709a989260214edc9b388.zip |
scsi: qla2xxx: Fix incorrect region-size setting in optrom SYSFS routines
commit 5cbdae10bf11f96e30b4d14de7b08c8b490e903c upstream.
Commit e6f77540c067 ("scsi: qla2xxx: Fix an integer overflow in sysfs
code") incorrectly set 'optrom_region_size' to 'start+size', which can
overflow option-rom boundaries when 'start' is non-zero. Continue setting
optrom_region_size to the proper adjusted value of 'size'.
Fixes: e6f77540c067 ("scsi: qla2xxx: Fix an integer overflow in sysfs code")
Signed-off-by: Andrew Vasquez <andrewv@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 5ef9fa6c5a91..b3deae861900 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -423,7 +423,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, } ha->optrom_region_start = start; - ha->optrom_region_size = start + size; + ha->optrom_region_size = size; ha->optrom_state = QLA_SREADING; ha->optrom_buffer = vmalloc(ha->optrom_region_size); @@ -495,7 +495,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, } ha->optrom_region_start = start; - ha->optrom_region_size = start + size; + ha->optrom_region_size = size; ha->optrom_state = QLA_SWRITING; ha->optrom_buffer = vmalloc(ha->optrom_region_size); |