From 5b3a7bd6f250518734a77565c2f9410f8a20f2a5 Mon Sep 17 00:00:00 2001 From: lihaoxiang Date: Wed, 24 Aug 2022 09:48:24 +0800 Subject: [PATCH] tune2fs: do not change j_tail_sequence in journal superblock From: @yanxiaodan Reviewed-by: @liuzhiqiang26 Signed-off-by: @liuzhiqiang26 --- ...hange-j_tail_sequence-in-journal-sup.patch | 38 +++++++++++++++++++ e2fsprogs.spec | 6 ++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 0044-tune2fs-do-not-change-j_tail_sequence-in-journal-sup.patch diff --git a/0044-tune2fs-do-not-change-j_tail_sequence-in-journal-sup.patch b/0044-tune2fs-do-not-change-j_tail_sequence-in-journal-sup.patch new file mode 100644 index 0000000..068a6e4 --- /dev/null +++ b/0044-tune2fs-do-not-change-j_tail_sequence-in-journal-sup.patch @@ -0,0 +1,38 @@ +From 003125b2f00aed8f0a1d8b5bd80fcbb1e8e2f13e Mon Sep 17 00:00:00 2001 +From: zhanchengbin +Date: Thu, 4 Aug 2022 18:33:39 +0800 +Subject: [PATCH] tune2fs: do not change j_tail_sequence in journal superblock + +The function recover_ext3_journal() in debugfs/journal.c, if the log +replay is over, the j_tail_sequence in journal superblock is not +changed to the value of the last transaction sequence. This will +cause subsequent log commitids to count from the commitid in last +time. After tune2fs -e, the log commitid is counted from the commitid +in last time, if the log ID of the current operation overlaps with +that of the last operation, this will cause logs that were previously +replayed by tune2fs to be replayed here. + +Signed-off-by: zhanchengbin +Signed-off-by: Zhiqiang Liu +Signed-off-by: liangyun +Signed-off-by: Theodore Ts'o +--- + debugfs/journal.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/debugfs/journal.c b/debugfs/journal.c +index c16daa5..5105235 100644 +--- a/debugfs/journal.c ++++ b/debugfs/journal.c +@@ -762,6 +762,8 @@ static errcode_t recover_ext3_journal(ext2_filsys fs) + mark_buffer_dirty(journal->j_sb_buffer); + } + ++ journal->j_tail_sequence = journal->j_transaction_sequence; ++ + errout: + journal_destroy_revoke(journal); + journal_destroy_revoke_caches(); +-- +1.8.3.1 + diff --git a/e2fsprogs.spec b/e2fsprogs.spec index d2f8d91..95fa747 100644 --- a/e2fsprogs.spec +++ b/e2fsprogs.spec @@ -1,6 +1,6 @@ Name: e2fsprogs Version: 1.45.6 -Release: 11 +Release: 12 Summary: Second extended file system management tools License: GPLv2 and LGPLv2 and GPLv2+ URL: http://e2fsprogs.sourceforge.net/ @@ -50,6 +50,7 @@ Patch40: 0040-e2fsck-add-env-param-E2FS_UNRELIABLE_IO-to-fi.patch Patch41: 0041-e2fsck-do-not-clean-up-file-acl-if-the-inode-is-trun.patch Patch42: 0042-e2fsck-handle-level-is-overflow-in-ext2fs_extent_get.patch Patch43: 0043-libext2fs-add-sanity-check-to-extent-manipulation.patch +Patch44: 0044-tune2fs-do-not-change-j_tail_sequence-in-journal-sup.patch BuildRequires: gcc pkgconfig texinfo BuildRequires: fuse-devel libblkid-devel libuuid-devel @@ -171,6 +172,9 @@ exit 0 %{_mandir}/man8/* %changelog +* Mon Aug 15 2022 yanxiaodan - 1.45.6-12 +- tune2fs: do not change j_tail_sequence in journal superblock + * Sat May 28 2022 zhanchengbin - 1.45.6-11 - e2fsck: fix CVE-2022-1304 -- Gitee