* [BUG] mm/gup: WARNING: mm/page-writeback.c:2678 at __folio_mark_dirty on v7.4-rc3
@ 2026-11-21 14:49 Yi Wen
2026-11-21 16:44 ` David Hildenbrand (Arm)
0 siblings, 1 reply; 2+ messages in thread
From: Yi Wen @ 2026-11-21 14:49 UTC (permalink / raw)
To: David Hildenbrand, linux-mm; +Cc: linux-kernel, linux-ext4
Hi,
I am reporting a kernel WARNING triggered by a syzkaller reproducer on
Linux v7.4-rc3.
The reproducer triggers a WARNING in ext4_dirty_folio() when
process_vm_writev() writes to a file-backed mapping.
The call trace shows that the warning occurs during the GUP page
unpinning and dirtying path:
process_vm_writev()
-> process_vm_rw_core()
-> unpin_user_pages_dirty_lock()
-> folio_mark_dirty()
-> ext4_dirty_folio()
A second WARNING is subsequently triggered in __folio_mark_dirty() in
mm/page-writeback.c.
This appears to be related to the interaction between GUP-based page
dirtying and filesystem-managed folio metadata. In particular, the GUP
dirtying path may mark a file-backed folio dirty without ensuring that
the filesystem-specific metadata required by its dirty_folio()
implementation remains available.
This may be related to the known issue where GUP-based page dirtying
does not properly notify the filesystem through page_mkwrite(), as
well as the interaction between GUP dirtying and
filemap_release_folio().
Before these warnings, all four ext4 loop devices also report delayed
block allocation errors and abnormal free block accounting. These
errors may indicate an additional filesystem inconsistency and are
included in the console log for further investigation.
Reproducer:
C reproducer: https://pastebin.com/raw/VMwNSqrp
console output: https://pastebin.com/raw/43Ne65Vu
kernel config: https://pastebin.com/raw/dG24GcY1
Kernel:
HEAD commit: aebb7274476403040d582c61478df8f4a7bf9cd3
Kernel version: Linux v7.4-rc3
Environment: QEMU virtual machine
WARNING 1:
WARNING: fs/ext4/inode.c:4527 at ext4_dirty_folio+0xe3/0x110
Call Trace:
ext4_dirty_folio+0xe3/0x110
folio_mark_dirty+0xb9/0x120
unpin_user_pages_dirty_lock+0x588/0x6e0
process_vm_rw_core.isra.0+0x7ad/0x960
process_vm_rw+0x1c1/0x260
__x64_sys_process_vm_writev+0xe3/0x1b0
do_syscall_64+0xee/0x4f0
entry_SYSCALL_64_after_hwframe+0x4b/0x53
WARNING 2:
WARNING: mm/page-writeback.c:2678 at __folio_mark_dirty+0x644/0x780
Call Trace:
__folio_mark_dirty+0x644/0x780
block_dirty_folio+0x149/0x1a0
folio_mark_dirty+0xb9/0x120
unpin_user_pages_dirty_lock+0x588/0x6e0
process_vm_rw_core.isra.0+0x7ad/0x960
process_vm_rw+0x1c1/0x260
__x64_sys_process_vm_writev+0xe3/0x1b0
do_syscall_64+0xee/0x4f0
entry_SYSCALL_64_after_hwframe+0x4b/0x53
Relevant ext4 messages:
EXT4-fs error (device loopX): ...
EXT4-fs (loopX): Delayed block allocation failed
EXT4-fs (loopX): This should not happen!
EXT4-fs (loopX): Total free blocks count 0
EXT4-fs (loopX): free_blocks=2415919104
The issue is reproducible on Linux v7.4-rc3.
The full console output and C reproducer are attached.
Best regards
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [BUG] mm/gup: WARNING: mm/page-writeback.c:2678 at __folio_mark_dirty on v7.4-rc3
2026-11-21 14:49 [BUG] mm/gup: WARNING: mm/page-writeback.c:2678 at __folio_mark_dirty on v7.4-rc3 Yi Wen
@ 2026-11-21 16:44 ` David Hildenbrand (Arm)
0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand (Arm) @ 2026-11-21 16:44 UTC (permalink / raw)
To: Yi Wen, linux-mm
Cc: linux-kernel, linux-ext4, Jan Kara, John Hubbard, Pedro Falcato
On 11/21/26 15:49, Yi Wen wrote:
> Hi,
>
> I am reporting a kernel WARNING triggered by a syzkaller reproducer on
> Linux v7.4-rc3.
>
> The reproducer triggers a WARNING in ext4_dirty_folio() when
> process_vm_writev() writes to a file-backed mapping.
>
> The call trace shows that the warning occurs during the GUP page
> unpinning and dirtying path:
>
> process_vm_writev()
> -> process_vm_rw_core()
> -> unpin_user_pages_dirty_lock()
> -> folio_mark_dirty()
> -> ext4_dirty_folio()
>
> A second WARNING is subsequently triggered in __folio_mark_dirty() in
> mm/page-writeback.c.
>
> This appears to be related to the interaction between GUP-based page
> dirtying and filesystem-managed folio metadata. In particular, the GUP
> dirtying path may mark a file-backed folio dirty without ensuring that
> the filesystem-specific metadata required by its dirty_folio()
> implementation remains available.
>
> This may be related to the known issue where GUP-based page dirtying
> does not properly notify the filesystem through page_mkwrite(), as
> well as the interaction between GUP dirtying and
> filemap_release_folio().
>
> Before these warnings, all four ext4 loop devices also report delayed
> block allocation errors and abnormal free block accounting. These
> errors may indicate an additional filesystem inconsistency and are
> included in the console log for further investigation.
>
Hi,
thanks for the report.
Did you only find this through syzcaller or by the help of an LLM?
I'm asking because the timing is interesting; this should be one of the problems
discussed by:
https://lore.kernel.org/r/20261119-gup-dirty-what-v1-0-236d69f25c24@suse.de
CCing Pedro, John und Jan.
--
Cheers,
David
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-21 16:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-21 14:49 [BUG] mm/gup: WARNING: mm/page-writeback.c:2678 at __folio_mark_dirty on v7.4-rc3 Yi Wen
2026-11-21 16:44 ` David Hildenbrand (Arm)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox