Blame SOURCES/e2fsprogs-1.42.11-e2fsck-free-ctx-fs-not-fs-at-the-end-of-fsck.patch
|
|
1f0cb0 |
From a82d88ea99d3c5c21bf538b886da0482bf143fd5 Mon Sep 17 00:00:00 2001
|
|
|
1f0cb0 |
From: "Darrick J. Wong" <darrick.wong@oracle.com>
|
|
|
1f0cb0 |
Date: Thu, 24 Jul 2014 21:03:54 -0400
|
|
|
1f0cb0 |
Subject: [PATCH] e2fsck: free ctx->fs, not fs, at the end of fsck
|
|
|
1f0cb0 |
|
|
|
1f0cb0 |
When we call ext2fs_close_free at the end of main(), we need to supply
|
|
|
1f0cb0 |
the address of ctx->fs, because the subsequent e2fsck_free_context
|
|
|
1f0cb0 |
call will try to access ctx->fs (which is now set to a freed block) to
|
|
|
1f0cb0 |
see if it should free the directory block list. This is clearly not
|
|
|
1f0cb0 |
desirable, so fix the problem.
|
|
|
1f0cb0 |
|
|
|
1f0cb0 |
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
|
1f0cb0 |
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
|
1f0cb0 |
---
|
|
|
1f0cb0 |
e2fsck/unix.c | 2 +-
|
|
|
1f0cb0 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
1f0cb0 |
|
|
|
1f0cb0 |
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
|
|
|
1f0cb0 |
index 8d1bdf3e..fc05bdee 100644
|
|
|
1f0cb0 |
--- a/e2fsck/unix.c
|
|
|
1f0cb0 |
+++ b/e2fsck/unix.c
|
|
|
1f0cb0 |
@@ -1774,7 +1774,7 @@ no_journal:
|
|
|
1f0cb0 |
io_channel_flush(ctx->fs->io);
|
|
|
1f0cb0 |
print_resource_track(ctx, NULL, &ctx->global_rtrack, ctx->fs->io);
|
|
|
1f0cb0 |
|
|
|
1f0cb0 |
- ext2fs_close_free(&fs);
|
|
|
1f0cb0 |
+ ext2fs_close_free(&ctx->fs);
|
|
|
1f0cb0 |
free(ctx->journal_name);
|
|
|
1f0cb0 |
|
|
|
1f0cb0 |
e2fsck_free_context(ctx);
|
|
|
1f0cb0 |
--
|
|
|
1f0cb0 |
2.20.1
|
|
|
1f0cb0 |
|