[PATCH v2 0/2] ocfs2: bound-check both readdir re-validation scans

From: Zhan Xusheng

Date: Mon Aug 10 2026 - 22:45:51 EST


Andrew, patch 1 replaces
ocfs2-bound-check-dir-entries-in-the-readdir-re-validation-scan.patch
in mm-nonmm-unstable. Patch 2 is new.

Both are against that tree rather than mainline, because the patch queued
ahead of them rewrote the ctx->pos line that is now in patch 1's trailing
context.

v1 only bounded the position before de is dereferenced. Joseph pointed out
that the walk has to stay inside the block as well, which is the second
guard ocfs2_check_dir_entry() applies for the emit loop; patch 1 adds it.
Checking whether anything else re-scans the same way turned up
ocfs2_dir_foreach_blk_id(), which walks the inline data area and is missing
both guards -- that is patch 2, which Joseph has not seen yet.

Neither patch carries Fixes: or Cc: stable, matching the trailers kept for
v1; please add them if you would rather they were there.

Link to v1: https://lore.kernel.org/all/20260806122133.956847-1-zhanxusheng@xxxxxxxxxx/

Zhan Xusheng (2):
ocfs2: bound-check dir entries in the readdir re-validation scan
ocfs2: bound-check dir entries in the inline-data re-validation scan

fs/ocfs2/dir.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)

--
2.43.0