Back

HIGH

btrfs: fix abort logic in btrfs_replace_file_extents

Published May 22, 2024

Description

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.

Affected products

Remediation

No remediation recorded yet.

Weaknesses (1)

References (8)

Change history (0)

No recorded changes yet.

Sources
CVE.org / MITRE
Status PUBLISHED
Assigner Linux
Published May 22, 2024
Updated Aug 5, 2026
Reserved May 21, 2024
CISA Vulnrichment
Updated Jun 10, 2024
NVD
Status Modified
Modified Aug 4, 2026
Red Hat
Severity Moderate
Public date May 22, 2024
ENISA EUVD
Assigner Linux
Published May 22, 2024
Updated Aug 5, 2026
Exploited since n/a
EUVD-2021-34438