From: Eric Sandeen Date: Mon, 9 Sep 2013 14:33:20 +0000 (-0400) Subject: e2fsck: don't try to stop mmp if there is no superblock set up X-Git-Tag: v1.42.9~151 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7ff040f30f0ff3bf5e2c832da3cb577e00a52d60;p=tools%2Fe2fsprogs.git e2fsck: don't try to stop mmp if there is no superblock set up Under some failure cases, we can get to fatal_error() without even having a superblock set up. In that case, ext2fs_mmp_stop() will segfault when it tries to dereference fs->super. Check for the existence of a superblock before we go down the ext2fs_mmp_stop() path to avoid this problem. Reported-by: Hubert Kario Addresses-Red-Hat-Bugzilla: #997972 Signed-off-by: Eric Sandeen Signed-off-by: "Theodore Ts'o" --- diff --git a/e2fsck/util.c b/e2fsck/util.c index 2b7d2ff..647e571 100644 --- a/e2fsck/util.c +++ b/e2fsck/util.c @@ -55,7 +55,7 @@ void fatal_error(e2fsck_t ctx, const char *msg) fprintf (stderr, "e2fsck: %s\n", msg); if (!fs) goto out; - if (fs->io) { + if (fs->io && fs->super) { ext2fs_mmp_stop(ctx->fs); if (ctx->fs->io->magic == EXT2_ET_MAGIC_IO_CHANNEL) io_channel_flush(ctx->fs->io);