From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Jeongjun Park <aha310510@gmail.com>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 5.4.y] jbd2: fix data-race and null-ptr-deref in jbd2_journal_dirty_metadata()
Date: Sat, 21 Jun 2025 04:52:21 -0400 [thread overview]
Message-ID: <20250620232958-999f278202013ebe@stable.kernel.org> (raw)
In-Reply-To: <20250620084958.26672-1-aha310510@gmail.com>
[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected.
No action required from the submitter.
The upstream commit SHA1 provided is correct: af98b0157adf6504fade79b3e6cb260c4ff68e37
Status in newer kernel trees:
6.15.y | Present (different SHA1: ddfb8877c6b5)
6.12.y | Present (different SHA1: 25cc031107f4)
6.6.y | Present (different SHA1: 543c9aed6f73)
6.1.y | Present (different SHA1: e7c29c3b1d88)
5.15.y | Present (different SHA1: b58688929dc8)
5.10.y | Present (different SHA1: b5960460d84e)
Note: The patch differs from the upstream commit:
---
1: af98b0157adf6 ! 1: e2e4e77718de3 jbd2: fix data-race and null-ptr-deref in jbd2_journal_dirty_metadata()
@@ Metadata
## Commit message ##
jbd2: fix data-race and null-ptr-deref in jbd2_journal_dirty_metadata()
+ commit af98b0157adf6504fade79b3e6cb260c4ff68e37 upstream.
+
Since handle->h_transaction may be a NULL pointer, so we should change it
to call is_handle_aborted(handle) first before dereferencing it.
@@ Commit message
Cc: stable@kernel.org
## fs/jbd2/transaction.c ##
-@@ fs/jbd2/transaction.c: int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
- jh->b_next_transaction == transaction);
- spin_unlock(&jh->b_state_lock);
- }
-- if (jh->b_modified == 1) {
-+ if (data_race(jh->b_modified == 1)) {
- /* If it's in our transaction it must be in BJ_Metadata list. */
- if (data_race(jh->b_transaction == transaction &&
- jh->b_jlist != BJ_Metadata)) {
@@ fs/jbd2/transaction.c: int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
goto out;
}
- journal = transaction->t_journal;
- spin_lock(&jh->b_state_lock);
+ jbd_lock_bh_state(bh);
if (is_handle_aborted(handle)) {
@@ fs/jbd2/transaction.c: int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.4.y | Success | Success |
prev parent reply other threads:[~2025-06-21 8:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 7:33 FAILED: patch "[PATCH] jbd2: fix data-race and null-ptr-deref in" failed to apply to 5.4-stable tree gregkh
2025-06-20 8:49 ` [PATCH 5.4.y] jbd2: fix data-race and null-ptr-deref in jbd2_journal_dirty_metadata() Jeongjun Park
2025-06-21 8:52 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250620232958-999f278202013ebe@stable.kernel.org \
--to=sashal@kernel.org \
--cc=aha310510@gmail.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.