zgetdump: Fix overflow/truncation in part_off calculation

When calculating partition start offset during multi-volume dump processing,
the result of multiplication is truncated to 32-bits thus resulting in
invalid behavior in case the real offset is beyond 4Gig boundary.

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.vnet.ibm.com>
Reviewed-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
This commit is contained in:
Mikhail Zaslonko
2018-01-12 08:49:52 +01:00
committed by Michael Holzheu
parent b4868c21bf
commit a74103dba7
2 changed files with 6 additions and 1 deletions

View File

@@ -3,6 +3,11 @@ Release history for s390-tools (MIT version)
* __v2.2.1 (xxxx-xx-xx)__
For Linux kernel version: 4.15
Bug Fixes:
- zgetdump: Fix handling of DASD multi-volume dump for partitions above 4 GB
* __v2.2.0 (2017-12-07)__
For Linux kernel version: 4.14

View File

@@ -242,7 +242,7 @@ static void vol_init(struct vol *vol, struct vol_parm *vol_parm, int ssid,
sprintf(vol->bus_id, "0.%x.%04x", ssid, vol_parm->devno);
vol->blk_size = vol_parm->blk_size << 8;
vol->part_off = vol_parm->start_blk * vol->blk_size;
vol->part_off = (u64)vol_parm->start_blk * vol->blk_size;
vol->part_size = blk_cnt * vol->blk_size;
vol->status = dev_from_busid(vol->bus_id, &vol->dev);
vol->sign = SIGN_VALID;