Skip to content

omfs: detect metadata chain cycles

이상호 lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2omfs: detect directory sibling chain cyclesfs/omfs/dir.c+63 -10 replies
2/2omfs: detect file extent chain cyclesfs/omfs/file.c+78 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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(-)
Signature · 1 line
2.43.0