btrfs: zlib: fix the folio leak on S390 hardware acceleration
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 |
|
|
In the Linux kernel, the following vulnerability has been resolved:
btrfs: zlib: fix the folio leak on S390 hardware acceleration
[BUG] After commit aa60fe12b4f4 ("btrfs: zlib: refactor S390x HW acceleration buffer preparation"), we no longer release the folio of the page cache of folio returned by btrfs_compress_filemap_get_folio() for S390 hardware acceleration path.
[CAUSE] Before that commit, we call kumap_local() and folio_put() after handling each folio.
Although the timing is not ideal (it release previous folio at the beginning of the loop, and rely on some extra cleanup out of the loop), it at least handles the folio release correctly.
Meanwhile the refactored code is easier to read, it lacks the call to release the filemap folio.
[FIX] Add the missing folio_put() for copy_data_into_buffer().
From the CVE record · Linux
The Linux kernel’s btrfs zlib compression path fails to release a page-cache folio when using S390 hardware acceleration, causing a folio leak. The input does not describe an attacker action, authentication requirement, or user interaction needed to trigger it.
Engineers running Linux kernels with btrfs zlib compression on S390 hardware acceleration should check their kernel; affected versions are not specified.