linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tune2fs: Fix overflow of interval check
@ 2011-04-19  6:11 Kazuya Mio
  2011-06-01  0:11 ` Ted Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Kazuya Mio @ 2011-04-19  6:11 UTC (permalink / raw)
  To: ext4, Theodore Tso

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"),

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tune2fs: Fix overflow of interval check
  2011-04-19  6:11 [PATCH] tune2fs: Fix overflow of interval check Kazuya Mio
@ 2011-06-01  0:11 ` Ted Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Ted Ts'o @ 2011-06-01  0:11 UTC (permalink / raw)
  To: Kazuya Mio; +Cc: ext4

On Tue, Apr 19, 2011 at 03:11:39PM +0900, Kazuya Mio wrote:
> 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>

Applied, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-01  2:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-19  6:11 [PATCH] tune2fs: Fix overflow of interval check Kazuya Mio
2011-06-01  0:11 ` Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).