nilfs2: fix BUG in nilfs_copy_dirty_pages() on dirty state mismatch
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8c26c4e2694a163d525976e804d81cd955bbb40c · < 66f4ad3ce158902e5f98afea93189972ed8750c2| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: fix BUG in nilfs_copy_dirty_pages() on dirty state mismatch
Syzbot reported a kernel BUG triggered within nilfs_copy_dirty_pages(), which copies dirty DAT file folios/pages to its shadow page cache. The BUG occurs when a retrieved dirty folio/page unexpectedly loses its 'dirty' status.
This issue arises because, since the commit referenced below, the 'dirty' flag of a folio/page can be cleared asynchronously after the filesystem detects metadata corruption and transitions to read-only mode.
Resolve the issue by returning an -EROFS error if the filesystem has transitioned to read-only mode. Also change the behavior to issue a kernel warning only once instead of triggering a kernel BUG when this unexpected 'dirty' state is detected while the filesystem is not in read-only mode.
From the CVE record · Linux
A dirty-state mismatch in nilfs2 can trigger a kernel BUG while copying dirty DAT pages, after metadata corruption causes the filesystem to transition to read-only mode. The input does not establish how an attacker could trigger this condition or specify access requirements or user interaction.
Engineers running Linux kernels with nilfs2 should check their kernel's status; affected versions are not specified.