From 94bd50c104b88fec62f2c586c1a7d39b5d8138ef Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 12 May 2025 14:05:46 +0800 Subject: [PATCH] jbd2: remove wrong sb->s_sequence check stable inclusion from stable-v5.10.237 commit b479839525fe7906966cdc4b5b2afbca048558a1 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IC6LPS CVE: CVE-2025-37839 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b479839525fe7906966cdc4b5b2afbca048558a1 -------------------------------- commit e6eff39dd0fe4190c6146069cc16d160e71d1148 upstream. Journal emptiness is not determined by sb->s_sequence == 0 but rather by sb->s_start == 0 (which is set a few lines above). Furthermore 0 is a valid transaction ID so the check can spuriously trigger. Remove the invalid WARN_ON. CC: stable@vger.kernel.org Signed-off-by: Jan Kara Reviewed-by: Zhang Yi Link: https://patch.msgid.link/20250206094657.20865-3-jack@suse.cz Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman Signed-off-by: Zizhi Wo --- fs/jbd2/journal.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 7775ad53b291..cc83decc6425 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1705,7 +1705,6 @@ int jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid, /* Log is no longer empty */ write_lock(&journal->j_state_lock); - WARN_ON(!sb->s_sequence); journal->j_flags &= ~JBD2_FLUSHED; write_unlock(&journal->j_state_lock); -- Gitee