diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 890c0f3f83ecf3f7e0fc631e51a30ea1341a23f0..9a4b7afb2a4e5d38cd436b343e1ec76fa8cf71ef 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1841,6 +1841,13 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token, } else if (token == Opt_commit) { if (arg == 0) arg = JBD2_DEFAULT_MAX_COMMIT_AGE; + else if (arg > INT_MAX / HZ) { + ext4_msg(sb, KERN_ERR, + "Invalid commit interval %d, " + "must be smaller than %d", + arg, INT_MAX / HZ); + return -1; + } sbi->s_commit_interval = HZ * arg; } else if (token == Opt_debug_want_extra_isize) { sbi->s_want_extra_isize = arg;