Executive brief
The Linux kernel's ext4 filesystem contains a memory leak in the orphan file initialization code. When orphan file blocks fail validation checks, the kernel does not properly release all allocated memory structures, causing a gradual accumulation of unreleased resources. This can degrade system performance and stability over time on systems with ext4 filesystems that encounter validation errors.
Technical details
A resource leak exists in ext4_init_orphan_info() where buffer_head structures obtained via ext4_bread() are not released when orphan block magic or checksum validation fails. The vulnerable code path jumps to an error handler that iterates backwards through buffer indices starting from i-1, skipping the buffer_head at the current index i and leaking its reference. The fix tracks the count of successfully loaded buffer_heads separately and releases exactly that number on the error path. The vulnerability affects orphan file initialization during filesystem mount or during operations that load orphan blocks, and requires the filesystem to have orphan blocks with invalid magic or checksum values to trigger.
Affected products
- Linux Linux kernel 4.15 and later (ext4 orphan file support)
Timeline
- 2026-07-09: disclosed: Initial patch submitted by Guanghui Yang
- 2026-07-22: patched: Patch merged to mainline by Theodore Ts'o
- 2026-09-14: patched: Backported to stable kernels