All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] e2fsck: don't try to stop mmp if there is no superblock set up
@ 2013-08-16 17:05 Eric Sandeen
  2013-09-09 14:33 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2013-08-16 17:05 UTC (permalink / raw)
  To: ext4 development; +Cc: Hubert Kario

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 <hkario@redhat.com>
Addresses-Red-Hat-Bugzilla: #997972
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/e2fsck/util.c b/e2fsck/util.c
index 9eaf557..18005f4 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);

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

* Re: [PATCH] e2fsck: don't try to stop mmp if there is no superblock set up
  2013-08-16 17:05 [PATCH] e2fsck: don't try to stop mmp if there is no superblock set up Eric Sandeen
@ 2013-09-09 14:33 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2013-09-09 14:33 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development, Hubert Kario

On Fri, Aug 16, 2013 at 12:05:55PM -0500, Eric Sandeen wrote:
> 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 <hkario@redhat.com>
> Addresses-Red-Hat-Bugzilla: #997972
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Thanks, applied.

					- Ted

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

end of thread, other threads:[~2013-09-09 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-16 17:05 [PATCH] e2fsck: don't try to stop mmp if there is no superblock set up Eric Sandeen
2013-09-09 14:33 ` Theodore Ts'o

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.