btrfs: do not clean up repair bio if submit fails
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
btrfs: do not clean up repair bio if submit fails
The submit helper will always run bio_endio() on the bio if it fails to submit, so cleaning up the bio just leads to a variety of use-after-free and NULL pointer dereference bugs because we race with the endio function that is cleaning up the bio. Instead just return BLK_STS_OK as the repair function has to continue to process the rest of the pages, and the endio for the repair bio will do the appropriate cleanup for the page that it was given.
From the CVE record · Linux
The Linux kernel’s btrfs repair path can race with bio completion when a repair bio fails to submit, causing use-after-free or NULL pointer dereference. The input does not establish how an attacker could trigger this condition, whether access or authentication is required, or whether user interaction is needed.
Engineers running Linux kernels with btrfs should check whether their kernel includes the fix; affected versions are not specified.