# CVE-2021-47433: btrfs: fix abort logic in btrfs_replace_file_extents

- Severity: High 8.1 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.58%, higher than 49% of CVEs (2026-12-02)
- Published: 2024-05-22T06:19:30.244Z
- Modified: 2026-08-05T08:47:47.653Z
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In 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.

(As written by CVE List.)

## Affected

- Linux Linux: from 8fccebfa534c7984864394fa03608305e4929aae before 0e32a2b85c7d92ece86c17dfef390c5ed79c6378; from 8fccebfa534c7984864394fa03608305e4929aae before 0e309e1152fc34ef75991d9d69b165dbf75bf26c; from 8fccebfa534c7984864394fa03608305e4929aae before 4afb912f439c4bc4e6a4f3e7547f2e69e354108f; 5.10 (not affected: before 5.10; from 5.10.75 up to 5.10.*; from 5.14.14 up to 5.14.*; from 5.15 up to *)
- linux linux_kernel: before 5.10.75; from 5.11 before 5.14.14; 5.15

## Every score

- Linux: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/0e32a2b85c7d92ece86c17dfef390c5ed79c6378> (patch)
- <https://git.kernel.org/stable/c/0e309e1152fc34ef75991d9d69b165dbf75bf26c> (patch)
- <https://git.kernel.org/stable/c/4afb912f439c4bc4e6a4f3e7547f2e69e354108f> (patch)

## Sources

- CVE List: [CVE-2021-47433](https://www.cve.org/CVERecord?id=CVE-2021-47433), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2021-47433](https://nvd.nist.gov/vuln/detail/CVE-2021-47433), Public domain, modified 2026-08-04

---

Page: https://cve.day/CVE-2021-47433 · Whole record: https://cve.day/CVE-2021-47433.json · Rebuilt by cve.day 2026-11-25T22:58:08.854Z
