CVE-2025-21722 Information
Description
In the Linux kernel the following vulnerability has been resolved:
nilfs2: do not force clear folio if buffer is referenced
Patch series ilfs2: protect busy buffer heads from being force-cleared.
This series fixes the buffer head state inconsistency issues reported by syzbot that occurs when the filesystem is corrupted and falls back to read-only and the associated buffer head use-after-free issue.
This patch (of 2):
Syzbot has reported that after nilfs2 detects filesystem corruption and falls back to read-only inconsistencies in the buffer state may occur.
One of the inconsistencies is that when nilfs2 calls mark_buffer_dirty() to set a data or metadata buffer as dirty but it detects that the buffer is not in the uptodate state:
WARNING: CPU: 0 PID: 6049 at fs/buffer.c:1177 mark_buffer_dirty+0x2e5/0x520
fs/buffer.c:1177
…
Call Trace:
The other is when nilfs_btree_propagate() which propagates the dirty state to the ancestor nodes of a b-tree that point to a dirty buffer detects that the origin buffer is not dirty even though it should be:
WARNING: CPU: 0 PID: 5245 at fs/nilfs2/btree.c:2089
nilfs_btree_propagate+0xc79/0xdf0 fs/nilfs2/btree.c:2089
…
Call Trace:
Both of these issues are caused by the callbacks that handle the page/folio write requests forcibly clear various states including the working state of the buffers they hold at unexpected times when they detect read-only fallback.
Fix these issues by checking if the buffer is referenced before clearing the page/folio state and skipping the clear if it is.
Reference
https://git.kernel.org/stable/c/1098bb8d52419d262a3358d099a1598a920b730f https://git.kernel.org/stable/c/19296737024cd220a1d6590bf4c092bca8c99497 https://git.kernel.org/stable/c/557ccf5e49f1fb848a29698585bcab2e50a597ef https://git.kernel.org/stable/c/ca76bb226bf47ff04c782cacbd299f12ddee1ec1
Share on: