Bug 155551

Summary: Fuzzed image causes btrfsck to enter endless loop ("Couldn't map the block")
Product: File System Reporter: Lukas Lueg (lukas.lueg)
Component: btrfsAssignee: Josef Bacik (josef)
Status: RESOLVED CODE_FIX    
Severity: normal CC: dsterba
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.6.6-300.fc24-x86_64 Subsystem:
Regression: No Bisected commit-id:
Attachments: btrfs-image causing endless loop in btrfsck
Log of

Description Lukas Lueg 2016-08-29 20:44:04 UTC
Created attachment 231331 [details]
btrfs-image causing endless loop in btrfsck

More news from the fuzzer. The attached image causes btrfsck to enter what seems to be an endless loop; using btrfs-progs v4.7-42-g56e9586.
Comment 1 Lukas Lueg 2016-08-29 20:44:28 UTC
Created attachment 231341 [details]
Log of
Comment 2 David Sterba 2016-09-09 13:43:26 UTC
Previous fixes lead to a different message but it still loops.

disk-io.c:331:ERROR: tree block bytenr 18446744073709551607 is not aligned to sectorsize 4096

The problem is in read_node_slot callers that do not always check for the right error condition. This will need some time to audit and fix all of them.
Comment 3 David Sterba 2017-08-25 17:21:06 UTC
Image added to the testsuite, now fixed in git.