public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ocfs2: stop BUG_ON crashes in suballoc invalid-dinode paths
@ 2026-04-03  6:30 ZhengYuan Huang
  2026-04-03  6:30 ` [PATCH 1/3] ocfs2: handle invalid dinode in reserve_suballoc_bits ZhengYuan Huang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ZhengYuan Huang @ 2026-04-03  6:30 UTC (permalink / raw)
  To: mark, jlbec, joseph.qi
  Cc: ocfs2-devel, linux-kernel, baijiaju1990, r33s3n6, zzzccc427,
	ZhengYuan Huang

commit 10995aa2451a ("ocfs2: Morph the haphazard
OCFS2_IS_VALID_DINODE() checks.") converted several OCFS2 dinode
corruption checks from graceful error handling to BUG_ON() under the
assumption that every caller only sees validated inode buffers.

That assumption does not always hold for JBD-managed buffers. The common
inode read path can still hand suballoc code an invalid dinode, which turns
crafted filesystem corruption into a kernel panic instead of a normal OCFS2
filesystem error.

This series restores graceful corruption handling at the three
independently reachable BUG_ON() sites in fs/ocfs2/suballoc.c:

1. reserve_suballoc_bits()
2. claim_suballoc_bits()
3. _ocfs2_free_suballoc_bits()

The series is split per crash site so each patch fixes one bug. A broader
follow-up could harden structural validation for JBD-managed inode reads,
but that change touches a much wider read-side contract and is kept out of
scope here.

ZhengYuan Huang (3):
  ocfs2: handle invalid dinode in reserve_suballoc_bits
  ocfs2: handle invalid dinode in claim_suballoc_bits
  ocfs2: handle invalid dinode in _ocfs2_free_suballoc_bits

 fs/ocfs2/suballoc.c | 33 +++++++++++++++++++++------------
 1 file changed, 21 insertions(+), 12 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-03  9:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03  6:30 [PATCH 0/3] ocfs2: stop BUG_ON crashes in suballoc invalid-dinode paths ZhengYuan Huang
2026-04-03  6:30 ` [PATCH 1/3] ocfs2: handle invalid dinode in reserve_suballoc_bits ZhengYuan Huang
2026-04-03  6:30 ` [PATCH 2/3] ocfs2: handle invalid dinode in claim_suballoc_bits ZhengYuan Huang
2026-04-03  6:30 ` [PATCH 3/3] ocfs2: handle invalid dinode in _ocfs2_free_suballoc_bits ZhengYuan Huang
2026-04-03  9:30 ` [PATCH 0/3] ocfs2: stop BUG_ON crashes in suballoc invalid-dinode paths Joseph Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox