CVE-2026-46061: jbd2: fix deadlock in jbd2_journal_cancel_revoke()
In the Linux kernel, the following vulnerability has been resolved:
jbd2: fix deadlock in jbd2journalcancelrevoke()
Commit f76d4c28a46a ("fs/jbd2: use sleeping version of findgetblock()") changed jbd2journalcancelrevoke() to use findgetblocknonatomic() which holds the folio lock instead of iprivatelock. This breaks the lock ordering (folio -> buffer) and causes an ABBA deadlock when the filesystem blocksize < pagesize:
T1 T2 ext4mkdir() ext4initnewdir() ext4append() ext4getblk() lockbuffer() <- A syncblockdev() blkdevwritepages() writebackiter() writebackgetfolio() foliolock() <- B ext4journalgetcreateaccess() jbd2journalcancelrevoke() findgetblocknonatomic() foliolock() <- B blockwritefullfolio() lockbuffer() <- A
This can occasionally cause generic/013 to hang.
Fix by only calling findgetblocknonatomic() when the passed bufferhead doesn't belong to the bdev, which is the only case that we need to look up its bdev alias. Otherwise, the lookup is redundant since the found bufferhead is equal to the one we passed in.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernelto a version that resolves this vulnerability.Patch f76d4c28a46a