Bug 155551 - Fuzzed image causes btrfsck to enter endless loop ("Couldn't map the block")
Summary: Fuzzed image causes btrfsck to enter endless loop ("Couldn't map the block")
Status: RESOLVED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: btrfs (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Josef Bacik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-29 20:44 UTC by Lukas Lueg
Modified: 2017-08-25 17:21 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.6.6-300.fc24-x86_64
Subsystem:
Regression: No
Bisected commit-id:


Attachments
btrfs-image causing endless loop in btrfsck (17.62 KB, application/gzip)
2016-08-29 20:44 UTC, Lukas Lueg
Details
Log of (15.53 KB, application/gzip)
2016-08-29 20:44 UTC, Lukas Lueg
Details

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.

Note You need to log in before you can comment on or make changes to this bug.