From: Kazuya Mio Date: Mon, 18 Apr 2011 20:11:39 +0000 (+0000) Subject: tune2fs: Fix overflow of interval check X-Git-Tag: v1.42-WIP-0702~13^2~9 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=2972b1637654e0c6ca0d7201384331dc250b2dc8;p=tools%2Fe2fsprogs.git tune2fs: Fix overflow of interval check Add the check of maximum check interval. s_checkinterval is 32bit variable, so it cannot be set more than 2^32. Signed-off-by: Kazuya Mio Signed-off-by: Theodore Ts'o --- diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 9d2b12c..7d5c092 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -1701,6 +1701,12 @@ retry_open: printf(_("Setting reserved blocks gid to %lu\n"), resgid); } if (i_flag) { + if (interval >= (1ULL << 32)) { + com_err(program_name, 0, + _("interval between checks is too big (%lu)"), + interval); + exit(1); + } sb->s_checkinterval = interval; ext2fs_mark_super_dirty(fs); printf(_("Setting interval between checks to %lu seconds\n"),