Files
erofs-freebsd-out-tree/tests/TC160-dot-omitted-offmax-cookie.md
T
2026-08-13 10:44:59 +02:00

1.3 KiB

Test Case: Dot-Omitted OFF_MAX Cookie Rejection

Test ID: TC160-dot-omitted-offmax-cookie Category: Directory Corruption Priority: Critical Regression: Synthetic dot at i_size + 1 overflowed signed directory offsets

Objective

Verify that a dot_omitted directory with i_size == OFF_MAX is rejected before the synthetic dot entry can create an unrepresentable cookie or negative offset.

Fixture

dot-omitted-offmax.erofs contains an extended directory inode with a valid backing block, flat-plain layout, the dot-omitted format bit, and i_size=9223372036854775807. The structured helper records every mutated field and the image hash.

Procedure

  1. Mount the fixture and require stat on /offmax-dir to report OFF_MAX.

  2. Run:

    truss -o tc160.truss \
      final_review_probe readdir-offmax /mnt/repo22-final/offmax-dir 97
    
  3. The helper first calls getdirentries at OFF_MAX, then at offset 0. Require EINTEGRITY both times and require the descriptor offset to remain exactly OFF_MAX and 0 respectively.

  4. Require both syscalls to show ERR#97, compare dmesg, and clean all resources.

Expected Results

  • No synthetic dot dirent or cookie is returned.
  • Both reads fail with positive errno 97.
  • No file offset becomes negative or advances after the error.