Repository navigation
test: take an unreadable inode in an unsorted block as the search's - #234
Merged
Merged
Conversation
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
enabled auto-merge
November 10, 2026 03:33
Author
|
Reviewed at 0619704 |
apostasie
approved these changes
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 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-imageandgateare 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 itnidOut, the rule the judge already has for it.testdata/fuzz/FuzzReaderEdits/b512-inode835-formatis the input, as a regression seed. The reader is unchanged.🧪 How:
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.just lintandjust testpass.📎 Annex: the input is b512 with two edits in
many/'s directory block. One renames an entry to2;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 finds2;2and refuses the inode as unsupported. The reader's search (erofs.go,dir.lookup) misses the name and never reads the inode.