|
|
1f0cb0 |
From 6efb6613deeca55b8e5673c77644890e7f5e4738 Mon Sep 17 00:00:00 2001
|
|
|
1f0cb0 |
From: Theodore Ts'o <tytso@mit.edu>
|
|
|
1f0cb0 |
Date: Wed, 8 Oct 2014 11:18:41 -0400
|
|
|
1f0cb0 |
Subject: [PATCH 13/16] e2fsck: fix free pointer dereferences
|
|
|
1f0cb0 |
|
|
|
1f0cb0 |
commit ebdf895b43a1ce499e4d2556a201e2a753fc422f
|
|
|
1f0cb0 |
|
|
|
1f0cb0 |
Commit 47fee2ef6a23a introduces some free pointer dereference bugs by
|
|
|
1f0cb0 |
not clearing ctx->fs after calling ext2fs_close_free().
|
|
|
1f0cb0 |
|
|
|
1f0cb0 |
Reported-by: Matthias Andree <mandree@FreeBSD.org>
|
|
|
1f0cb0 |
Cc: Lukas Czerner <lczerner@redhat.com>
|
|
|
1f0cb0 |
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
|
1f0cb0 |
---
|
|
|
1f0cb0 |
e2fsck/unix.c | 6 +++---
|
|
|
1f0cb0 |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
1f0cb0 |
|
|
|
1f0cb0 |
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
|
|
|
1f0cb0 |
index 84b9a454..bbf65d90 100644
|
|
|
1f0cb0 |
--- a/e2fsck/unix.c
|
|
|
1f0cb0 |
+++ b/e2fsck/unix.c
|
|
|
1f0cb0 |
@@ -458,7 +458,7 @@ static void check_if_skip(e2fsck_t ctx)
|
|
|
1f0cb0 |
}
|
|
|
1f0cb0 |
log_out(ctx, "\n");
|
|
|
1f0cb0 |
skip:
|
|
|
1f0cb0 |
- ext2fs_close_free(&fs);
|
|
|
1f0cb0 |
+ ext2fs_close_free(&ctx->fs);
|
|
|
1f0cb0 |
e2fsck_free_context(ctx);
|
|
|
1f0cb0 |
exit(FSCK_OK);
|
|
|
1f0cb0 |
}
|
|
|
1f0cb0 |
@@ -1461,7 +1461,7 @@ failure:
|
|
|
1f0cb0 |
/*
|
|
|
1f0cb0 |
* Restart in order to reopen fs but this time start mmp.
|
|
|
1f0cb0 |
*/
|
|
|
1f0cb0 |
- ext2fs_close_free(&fs);
|
|
|
1f0cb0 |
+ ext2fs_close_free(&ctx->fs);
|
|
|
1f0cb0 |
flags &= ~EXT2_FLAG_SKIP_MMP;
|
|
|
1f0cb0 |
goto restart;
|
|
|
1f0cb0 |
}
|
|
|
1f0cb0 |
@@ -1690,7 +1690,7 @@ no_journal:
|
|
|
1f0cb0 |
_("while resetting context"));
|
|
|
1f0cb0 |
fatal_error(ctx, 0);
|
|
|
1f0cb0 |
}
|
|
|
1f0cb0 |
- ext2fs_close_free(&fs);
|
|
|
1f0cb0 |
+ ext2fs_close_free(&ctx->fs);
|
|
|
1f0cb0 |
goto restart;
|
|
|
1f0cb0 |
}
|
|
|
1f0cb0 |
if (run_result & E2F_FLAG_CANCEL) {
|
|
|
1f0cb0 |
--
|
|
|
1f0cb0 |
2.20.1
|
|
|
1f0cb0 |
|