jfs: fix use-after-free races during unmount
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 0 repliesNew
- v11 patch 0 repliesSuperseded
Changes in v2 from the cover letter
- 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
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | jfs: drain lazy commit queue during unmount to prevent use-after-freefs/ fs/ fs/ | +44 | 0 replies | |
| 2/2 | jfs: wait for in-flight log I/O before freeing lbufs in lbmLogShutdownfs/ fs/ | +14 | 0 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by.
| Patch | [email protected] | [email protected] |
|---|---|---|
| 1/2 | T-b | T-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] jfs: fix use-after-free races during unmount
From: Tristan Madani <[email protected]>
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(+)
Signature · 1 line
2.47.3