Skip to content

test: take an unreadable inode in an unsorted block as the search's - #234

Merged
closer-claudio merged 1 commit into
mainfrom
claudio/20261109-reader-inode-format
Nov 10, 2026
Merged

closer-claudio merged 1 commit into
mainfrom
claudio/20261109-reader-inode-format

Conversation

@closer-claudio

Copy link
Copy Markdown

🎯 Why: FuzzReaderEdits fails on an input where the reader is right. In a directory block that is out of name order, the reference's search finds a name the reader's search misses, and the inode it names cannot be read. The differential took that for a reader accepting what the kernel refuses, so fuzz-image and gate are red on every pull request whose run hits the input, #233 included.

🛠️ What: contract_test.go, refWalker.entry: in an unsorted block, any error reading the inode the reference's search found makes the entry unreachable, where only an inode past the image did before. The unreachable path then marks it nidOut, the rule the judge already has for it. testdata/fuzz/FuzzReaderEdits/b512-inode835-format is the input, as a regression seed. The reader is unchanged.

🧪 How:

  • V: on main, the seed fails with "the reader does not refuse what the kernel cannot read (reference: erofsspec: unsupported format: inode 835 i_format 0xfa; reader: )". With the change it passes.
  • V: just lint and just test pass.

📎 Annex: the input is b512 with two edits in many/'s directory block. One renames an entry to 2;2, putting the block out of order. The other points that entry at nid 835, whose i_format is 0xfa. The reference follows namei.c's search: it finds 2;2 and refuses the inode as unsupported. The reader's search (erofs.go, dir.lookup) misses the name and never reads the inode.

In a directory block out of name order, which names a binary search
finds depends on the search, and the differential already treats that
as no verdict on the image (unsortedDir). refWalker.entry tolerated one
case of it: the reference's search finding a name whose inode lies past
the image. An inode it finds there but refuses for another reason is the
same case. FuzzReaderEdits found one: b512 with two edits in many/'s
directory block renames an entry to "2;2" and points it at nid 835, whose
i_format is 0xfa. The reference's search (namei.c's) finds "2;2" and
refuses the inode as unsupported; the reader's search misses the name,
never reads the inode, and serves the tree, which the judge took for a
reader that accepts what the kernel cannot read.

Any inode error in an unsorted block now makes the entry unreachable, so
the unreachable path marks it nidOut, as it does for a missed name. The
reader is unchanged. The fuzz input is committed as a regression seed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: closer-claudio <claudio@farcloser.world>
@closer-claudio closer-claudio added the internal Changes nothing for a consumer; left out of release notes label Nov 10, 2026
@closer-claudio

Copy link
Copy Markdown
Author

Reviewed at 0619704

@closer-claudio
closer-claudio merged commit 3fae0f9 into main Nov 10, 2026
20 checks passed
@closer-claudio
closer-claudio deleted the claudio/20261109-reader-inode-format branch November 10, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Changes nothing for a consumer; left out of release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants