mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ocfs2: validate non-coherent freefrag bitmap inode
@ 2026-10-18 11:41 Jiale Yao
  2026-10-20  7:43 ` Joseph Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Jiale Yao @ 2026-10-18 11:41 UTC (permalink / raw)
  To: Mark Fasheh, Joel Becker, Joseph Qi, Heming Zhao, Tristan Ye,
	ocfs2-devel, linux-kernel
  Cc: Jiale Yao

The non-coherent freefrag ioctl path reads the global bitmap inode
directly and trusts its chain list. A malformed cl_next_free_rec value
can therefore index beyond cl_recs while scanning chains.

Validate the inode block before consuming its bitmap and chain metadata.

Fixes: d24a10b9f8ed ("Ocfs2: Add a new code 'OCFS2_INFO_FREEFRAG' for o2info ioctl.")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
 fs/ocfs2/ioctl.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index cbe59d231666..8383f900c847 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -575,6 +575,12 @@ static int ocfs2_info_freefrag_scan_bitmap(struct ocfs2_super *osb,
 			mlog_errno(status);
 			goto bail;
 		}
+
+		status = ocfs2_validate_inode_block(osb->sb, bh);
+		if (status < 0) {
+			mlog_errno(status);
+			goto bail;
+		}
 	}
 
 	gb_dinode = (struct ocfs2_dinode *)bh->b_data;
-- 
2.34.1


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

end of thread, other threads:[~2026-10-20  7:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-18 11:41 [PATCH] ocfs2: validate non-coherent freefrag bitmap inode Jiale Yao
2026-10-20  7:43 ` Joseph Qi
2026-10-20  7:57   ` jiale yao

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

all inboxes | Powered by JetHome®