btrfs: fix abort logic in btrfs_replace_file_extents
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
5.10.755.14.145.15In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix abort logic in btrfs_replace_file_extents
Error injection testing uncovered a case where we'd end up with a corrupt file system with a missing extent in the middle of a file. This occurs because the if statement to decide if we should abort is wrong.
The only way we would abort in this case is if we got a ret != -EOPNOTSUPP and we called from the file clone code. However the prealloc code uses this path too. Instead we need to abort if there is an error, and the only error we _don't_ abort on is -EOPNOTSUPP and only if we came from the clone file code.
From the CVE record · Linux
The Linux kernel's btrfs extent-replacement logic can fail to abort after an error, leaving a missing extent in the middle of a file and corrupting the filesystem. Error-injection testing found the issue in a path also used by preallocation; the input does not establish an attacker scenario, authentication requirement, or user-interaction requirement.
Engineers running Linux kernels with btrfs should check their versions; affected versions are not specified.