[Debian-ha-commits] [ocfs2-tools] 01/58: tunefs.ocfs2: fix a potential overflowing problem in check_new_size
Valentin Vidic
vvidic-guest at moszumanska.debian.org
Tue Jun 20 13:40:39 UTC 2017
This is an automated email from the git hooks/post-receive script.
vvidic-guest pushed a commit to branch upstream
in repository ocfs2-tools.
commit 26411649a527420156643c97c5f860d182e3a8c5
Author: Jun Piao <piaojun at huawei.com>
Date: Tue May 24 07:24:42 2016 +0800
tunefs.ocfs2: fix a potential overflowing problem in check_new_size
Potentially overflowing expression "0xffffffffU << b_to_c_bits" with
type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit
arithmetic before being used in a context which expects an expression
of type "uint64_t" (64 bits, unsigned). To avoid overflow, cast the left
operand to "uint64_t" before performing the left shift.
Fixes: 15f01d8d8c1c ("tunefs.ocfs2: Warn if not using complete device")
Signed-off-by: Jun Piao <piaojun at huawei.com>
Reviewed-by: Gang He <ghe at suse.com>
Signed-off-by: Joseph Qi <joseph.qi at huawei.com>
---
tunefs.ocfs2/op_resize_volume.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tunefs.ocfs2/op_resize_volume.c b/tunefs.ocfs2/op_resize_volume.c
index 076bda0..84d8628 100644
--- a/tunefs.ocfs2/op_resize_volume.c
+++ b/tunefs.ocfs2/op_resize_volume.c
@@ -543,7 +543,7 @@ static errcode_t check_new_size(ocfs2_filesys *fs, uint64_t new_size,
"Clusters (%"PRIu64" is greater than "
"maximum possible clusters %"PRIu32"\n",
device_clusters, UINT32_MAX);
- try_blocks = UINT32_MAX << b_to_c_bits;
+ try_blocks = (uint64_t)UINT32_MAX << b_to_c_bits;
errorf("Clusters %"PRIu64" is greater than max allowed"
" %"PRIu32".\nIf you want to resize to %"PRIu64
" blocks please specify %"PRIu64" as "
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/ocfs2-tools.git
More information about the Debian-HA-Commits
mailing list