nilfs2: fix WARNING in mark_buffer_dirty due to discarded buffer reuse
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8c26c4e2694a163d525976e804d81cd955bbb40c · < 4da07e958bfda2d69d83db105780e8916e3ac02e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: fix WARNING in mark_buffer_dirty due to discarded buffer reuse
A syzbot stress test using a corrupted disk image reported that mark_buffer_dirty() called from __nilfs_mark_inode_dirty() or nilfs_palloc_commit_alloc_entry() may output a kernel warning, and can panic if the kernel is booted with panic_on_warn.
This is because nilfs2 keeps buffer pointers in local structures for some metadata and reuses them, but such buffers may be forcibly discarded by nilfs_clear_dirty_page() in some critical situations.
This issue is reported to appear after commit 28a65b49eb53 ("nilfs2: do not write dirty data after degenerating to read-only"), but the issue has potentially existed before.
Fix this issue by checking the uptodate flag when attempting to reuse an internally held buffer, and reloading the metadata instead of reusing the buffer if the flag was lost.
From the CVE record · Linux
The Linux kernel’s nilfs2 filesystem can reuse a discarded metadata buffer, causing a kernel warning when processing a corrupted disk image. A stress test triggered the warning; the kernel can panic if booted with panic_on_warn. The input does not establish whether authentication is required or whether the issue can be triggered over a network.
Engineers running Linux kernels with nilfs2 should check their systems; affected versions are not specified.