From: David Teigland Date: Mon, 11 Sep 2023 17:18:12 +0000 (-0500) Subject: lvresize: fix 32 bit overflow in size calculation X-Git-Tag: v2_03_24~597 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=refs%2Fpipelines%2F999979404;p=lvm2.git lvresize: fix 32 bit overflow in size calculation --- diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index f9bc3c34e..722e41a63 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -6445,7 +6445,7 @@ static int _fs_reduce(struct cmd_context *cmd, struct logical_volume *lv, } /* extent_size units is SECTOR_SIZE (512) */ - newsize_bytes_lv = lp->extents * lv->vg->extent_size * SECTOR_SIZE; + newsize_bytes_lv = (uint64_t) lp->extents * lv->vg->extent_size * SECTOR_SIZE; newsize_bytes_fs = newsize_bytes_lv; /* @@ -6591,7 +6591,7 @@ static int _fs_extend(struct cmd_context *cmd, struct logical_volume *lv, */ /* extent_size units is SECTOR_SIZE (512) */ - newsize_bytes_lv = lp->extents * lv->vg->extent_size * SECTOR_SIZE; + newsize_bytes_lv = (uint64_t) lp->extents * lv->vg->extent_size * SECTOR_SIZE; newsize_bytes_fs = newsize_bytes_lv; if (fsinfo.needs_crypt) { newsize_bytes_fs -= fsinfo.crypt_offset_bytes;