summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorKazuya Mio <k-mio@sx.jp.nec.com>2011-04-18 20:11:39 +0000
committerTheodore Ts'o <tytso@mit.edu>2011-05-31 20:07:38 -0400
commit2972b1637654e0c6ca0d7201384331dc250b2dc8 (patch)
treeae72961ce63a86b22f180e092187ddaccf0891aa /misc
parentb1503c446a9cd3041c94945df7a9772e812dbd21 (diff)
downloade2fsprogs-2972b1637654e0c6ca0d7201384331dc250b2dc8.tar.gz
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 <k-mio@sx.jp.nec.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'misc')
-rw-r--r--misc/tune2fs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 9d2b12cc..7d5c092b 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"),