CVE-2026-80881: ocfs2: fix buffer head management in ocfs2_read_blocks()
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: fix buffer head management in ocfs2readblocks()
In ocfs2readblocks(), caller should't assume that buffer head returned by 'sbgetblk()' is exclusively owned and so 'putbh()' always drops bcount from 1 to 0. If it is not so, buffer head remains on hold and likely to be returned by the next call to 'sbgetblk()' unchanged - that is, with BHUptodate bit set even if it has failed validation previously, thus allowing to insert that buffer head into OCFS2 metadata cache and submit it to upper layers. To avoid such a scenario, BHUptodate should be cleared immediately after 'validate()' callback has detected some data inconsistency.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
The issue affects Linux kernel systems using the OCFS2 filesystem code path involving ocfs2_read_blocks(). The described failure concerns OCFS2 metadata-cache handling after a buffer validation failure.
What condition leads to stale buffer state being reused?
A buffer must fail the validate() callback because of detected data inconsistency while its buffer-head reference count remains held. A subsequent sb_getblk() call can then return the same buffer with BH_Uptodate still set, allowing it to enter the OCFS2 metadata cache.
What is the relevant remediation in the fixed code?
The fix clears BH_Uptodate immediately when validate() detects an inconsistency. This prevents a previously failed buffer from being treated as up to date on later reuse.