ext4: fix buffer_head leak in ext4_init_orphan_info
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 02f310fcf47fa9311d6ba2946a8d19e7d7d11f37 · < e1e342d9a561c016b8531ec1f4dcefaad9d64954| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ext4: fix buffer_head leak in ext4_init_orphan_info
ext4_init_orphan_info() reads orphan file blocks with ext4_bread() and stores the returned buffer_head in oi->of_binfo[i].ob_bh.
If ext4_bread() succeeds but the orphan block magic or checksum validation fails, the function jumps to out_free. However, the old out_free loop starts releasing buffers from i - 1, so the current buffer_head at index i is skipped.
This leaks the buffer_head reference obtained by ext4_bread() on the bad magic and bad checksum error paths.
Fix this by tracking the number of successfully read buffer_heads and releasing exactly those buffer_heads on the error path.
From the CVE record · Linux
The Linux kernel’s ext4 orphan-file initialization can leak a buffer_head reference when an orphan block fails magic or checksum validation. The input does not establish whether an attacker can trigger this condition or specify any access or user-interaction requirements.
Engineers running Linux kernels that use ext4 should check whether their kernel includes the fix; affected versions are not specified.