From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: [PATCH] e2fsprogs: check for bogus new_size in resize2fs
Date: Fri, 10 Oct 2008 17:38:15 -0500 [thread overview]
Message-ID: <48EFD957.3000406@redhat.com> (raw)
Resolves RH Bug 465984 - resize2fs doesn't recognize bogus argument, ending in infinite loop
If we don't check for new_size == 0, bogus values send resize2fs into
a tailspin:
resize2fs 1.41.0 (10-Jul-2008)
Illegal block number passed to ext2fs_test_block_bitmap #1 for block bitmap for
/tmp/tmp.lntZtMFvz8/fake-disk
...the same message repeated zillion times...
Probably should see where that loop is, but at any rate we should
error-check parse_num_blocks.
Thanks to Petr Muller for reporting this.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
Index: e2fsprogs/resize/main.c
===================================================================
--- e2fsprogs.orig/resize/main.c
+++ e2fsprogs/resize/main.c
@@ -376,6 +376,11 @@ int main (int argc, char ** argv)
else if (new_size_str) {
new_size = parse_num_blocks(new_size_str,
fs->super->s_log_block_size);
+ if (new_size == 0) {
+ com_err(program_name, 0,
+ _("Invalid new size: %s\n"), new_size_str);
+ exit(1);
+ }
} else {
new_size = max_size;
/* Round down to an even multiple of a pagesize */
reply other threads:[~2008-10-10 22:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=48EFD957.3000406@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-ext4@vger.kernel.org \
/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.