From: Kazuya Mio <k-mio@sx.jp.nec.com>
To: ext4 <linux-ext4@vger.kernel.org>, Theodore Tso <tytso@mit.edu>
Subject: [PATCH] tune2fs: Fix overflow of interval check
Date: Tue, 19 Apr 2011 15:11:39 +0900 [thread overview]
Message-ID: <4DAD279B.8070905@sx.jp.nec.com> (raw)
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>
---
misc/tune2fs.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index bcada11..625866f 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -1705,6 +1705,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"),
next reply other threads:[~2011-04-19 6:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-19 6:11 Kazuya Mio [this message]
2011-06-01 0:11 ` [PATCH] tune2fs: Fix overflow of interval check Ted Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DAD279B.8070905@sx.jp.nec.com \
--to=k-mio@sx.jp.nec.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.