btrfs: fix extent map leak in NOCOW direct I/O write
No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 0%. Fixed in Kernel f42efd634c0ae7ba0ce2fc5e30e291b0803b0ae2, Kernel 05a1a816eef8b3e4332620a64fc8cf45c4eb5c0d, Kernel 3f950867c307c5413d628a153ac44915bd117ffd and 8 more.
In the Linux kernel, the following vulnerability has been resolved: btrfs: fix extent map leak in NOCOW direct I/O write btrfs_dio_iomap_begin() calls btrfs_get_extent(), which returns an extent map reference that must be dropped on all exit paths. For direct writes into a NOCOW range, btrfs_get_blocks_direct_write() keeps using that extent map and asks btrfs_create_dio_extent() to allocate the ordered extent. If that fails, for example because btrfs_alloc_ordered_extent() fails, the function returns the error without dropping the input extent map. The PREALLOC path avoided this by dropping the input extent map before replacing it with the newly created one. Check the error from btrfs_create_dio_extent() before replacing the map and drop the input extent map on failure.
Affected
Vendors, products and packages with version ranges
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| Linux | Kernel | >=5f9a8a51d8b95505d8de8b7191ae2ed8c504d4af <f42efd634c0ae7ba0ce2fc5e30e291b0803b0ae2, >=5f9a8a51d8b95505d8de8b7191ae2ed8c504d4af <05a1a816eef8b3e4332620a64fc8cf45c4eb5c0d, >=5f9a8a51d8b95505d8de8b7191ae2ed8c504d4af <3f950867c307c5413d628a153ac44915bd117ffd, >=5f9a8a51d8b95505d8de8b7191ae2ed8c504d4af <8d264d35df981e943171ddc09cd6cc1d38c65e17, >=5f9a8a51d8b95505d8de8b7191ae2ed8c504d4af <b7c873765875645b11503f94c9bae2ca80127375, >=5f9a8a51d8b95505d8de8b7191ae2ed8c504d4af <cb732d302245b14943a5017015fffa8e6db7a6c0, =4.7 | f42efd634c0ae7ba0ce2fc5e30e291b0803b0ae2, 05a1a816eef8b3e4332620a64fc8cf45c4eb5c0d, 3f950867c307c5413d628a153ac44915bd117ffd, 8d264d35df981e943171ddc09cd6cc1d38c65e17, b7c873765875645b11503f94c9bae2ca80127375, cb732d302245b14943a5017015fffa8e6db7a6c0 |
| linux-kernel: Kernel | >=6.13.0 <6.18.50, >=6.19.0 <7.2.4, >=6.2.0 <6.6.160, >=6.7.0 <6.12.111, >=4.7.0 <6.1.191 | 6.18.50, 7.2.4, 6.6.160, 6.12.111, 6.1.191 |
Timeline
Every event on this vulnerability
Related
Other vulnerabilities in Kernel, strongest first
Embed
A live severity badge for an advisory, README or ticket