From: Tristan Madani <tristmd@gmail.com>
To: Dave Kleikamp <shaggy@kernel.org>
Cc: jfs-discussion@lists.sourceforge.net,
linux-kernel@vger.kernel.org,
syzbot+c244f4a09ca85dd2ebc1@syzkaller.appspotmail.com,
syzbot+885a4f3281b8d99c48d8@syzkaller.appspotmail.com,
stable@vger.kernel.org,
Tristan Madani <tristan@talencesecurity.com>
Subject: [PATCH v2 0/2] jfs: fix use-after-free races during unmount
Date: Tue, 5 May 2026 12:33:28 +0000 [thread overview]
Message-ID: <20260505123330.2822833-1-tristmd@gmail.com> (raw)
In-Reply-To: <20260501110236.43226-1-tristmd@gmail.com>
From: Tristan Madani <tristan@talencesecurity.com>
Two related UAF races exist in JFS unmount:
1. jfs_lazycommit accesses freed jfs_sb_info/jfs_log after unmount
proceeds past jfs_flush_journal but before jfsCommit drains
TxAnchor.unlock_queue.
2. lbmIODone (BIO completion in softirq) accesses freed lbuf fields
after lbmLogShutdown frees all lbufs from the freelist.
V1 fixed only race #1. Syzbot testing showed that race #2 can
still trigger independently. This V2 adds a second patch for the
BIO completion race.
Changes since v1:
- Split into two patches (one per race)
- NEW: patch 2/2 adds atomic io_count to drain in-flight BIO
completions before lbmLogShutdown frees lbufs
Tristan Madani (2):
jfs: drain lazy commit queue during unmount to prevent use-after-free
jfs: wait for in-flight log I/O before freeing lbufs in lbmLogShutdown
fs/jfs/jfs_logmgr.c | 10 ++++++++++
fs/jfs/jfs_logmgr.h | 2 ++
fs/jfs/jfs_txnmgr.c | 35 +++++++++++++++++++++++++++++++++++
fs/jfs/jfs_txnmgr.h | 1 +
fs/jfs/jfs_umount.c | 8 ++++++++
5 files changed, 56 insertions(+)
--
2.47.3
next prev parent reply other threads:[~2026-05-05 12:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-01 11:02 [PATCH] jfs: drain lazy commit queue during unmount to prevent use-after-free Tristan Madani
2026-05-05 12:33 ` Tristan Madani [this message]
2026-05-05 12:33 ` [PATCH v2 1/2] " Tristan Madani
2026-05-05 12:33 ` [PATCH v2 2/2] jfs: wait for in-flight log I/O before freeing lbufs in lbmLogShutdown Tristan Madani
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=20260505123330.2822833-1-tristmd@gmail.com \
--to=tristmd@gmail.com \
--cc=jfs-discussion@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=shaggy@kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+885a4f3281b8d99c48d8@syzkaller.appspotmail.com \
--cc=syzbot+c244f4a09ca85dd2ebc1@syzkaller.appspotmail.com \
--cc=tristan@talencesecurity.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox