[PATCH 0/2] omfs: detect metadata chain cycles

From: 이상호

Date: Wed Jul 01 2026 - 18:02:19 EST


OMFS stores directory sibling chains and file extent continuation chains
on disk. Both chains are terminated by ~0, but the next block values are
image-controlled.

A crafted filesystem can create a cycle in either chain. Lookup of a
missing directory entry or read of a file with a cyclic extent
continuation then loops in the kernel.

This series detects cycles in both metadata chains. I verified the fixes
with crafted OMFS images:

- directory sibling self-cycle:
unpatched kernel timed out after "statting /mnt/missing";
patched kernel returned ELOOP.

- file extent continuation self-cycle:
unpatched kernel timed out after "reading /mnt/loopfile";
patched kernel returned from read with EIO.

Valid directory and file images continued to behave normally.

이상호 (2):
omfs: detect directory sibling chain cycles
omfs: detect file extent chain cycles

fs/omfs/dir.c | 64 +++++++++++++++++++++++++++++++++++++++-
fs/omfs/file.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 141 insertions(+), 2 deletions(-)

--
2.43.0