syzbot


KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range (4)

Status: moderation: reported on 2025/03/29 00:44
Subsystems: mm iomap
[Documentation on labels]
Reported-by: syzbot+77fc12ba43c71e3d4802@syzkaller.appspotmail.com
First crash: 153d, last: 9d19h
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range (2) mm 6 4 1006d 1051d 0/29 auto-obsoleted due to no activity on 2023/01/03 00:13
upstream KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range (3) mm 6 75 445d 629d 0/29 auto-obsoleted due to no activity on 2024/07/14 21:23
upstream KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range iomap 6 5 1273d 1321d 0/29 auto-closed as invalid on 2022/04/09 14:24

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range

read-write to 0xffff888119c082d8 of 8 bytes by task 5159 on cpu 0:
 page_cache_delete mm/filemap.c:146 [inline]
 __filemap_remove_folio+0x1bc/0x2a0 mm/filemap.c:224
 __remove_mapping+0x338/0x460 mm/vmscan.c:813
 remove_mapping+0x22/0x90 mm/vmscan.c:846
 mapping_evict_folio mm/truncate.c:314 [inline]
 mapping_try_invalidate+0x26a/0x3f0 mm/truncate.c:535
 invalidate_mapping_pages+0x27/0x40 mm/truncate.c:577
 ext4_dio_write_iter fs/ext4/file.c:629 [inline]
 ext4_file_write_iter+0xe70/0xf00 fs/ext4/file.c:721
 iter_file_splice_write+0x663/0xa60 fs/splice.c:738
 do_splice_from fs/splice.c:938 [inline]
 direct_splice_actor+0x153/0x2a0 fs/splice.c:1161
 splice_direct_to_actor+0x30f/0x680 fs/splice.c:1105
 do_splice_direct_actor fs/splice.c:1204 [inline]
 do_splice_direct+0xda/0x150 fs/splice.c:1230
 do_sendfile+0x380/0x650 fs/read_write.c:1370
 __do_sys_sendfile64 fs/read_write.c:1431 [inline]
 __se_sys_sendfile64 fs/read_write.c:1417 [inline]
 __x64_sys_sendfile64+0x105/0x150 fs/read_write.c:1417
 x64_sys_call+0x2bb0/0x2ff0 arch/x86/include/generated/asm/syscalls_64.h:41
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888119c082d8 of 8 bytes by task 5138 on cpu 1:
 mapping_needs_writeback mm/filemap.c:641 [inline]
 filemap_write_and_wait_range+0x59/0x340 mm/filemap.c:690
 ext4_dio_write_iter fs/ext4/file.c:626 [inline]
 ext4_file_write_iter+0xe04/0xf00 fs/ext4/file.c:721
 iter_file_splice_write+0x663/0xa60 fs/splice.c:738
 do_splice_from fs/splice.c:938 [inline]
 direct_splice_actor+0x153/0x2a0 fs/splice.c:1161
 splice_direct_to_actor+0x30f/0x680 fs/splice.c:1105
 do_splice_direct_actor fs/splice.c:1204 [inline]
 do_splice_direct+0xda/0x150 fs/splice.c:1230
 do_sendfile+0x380/0x650 fs/read_write.c:1370
 __do_sys_sendfile64 fs/read_write.c:1431 [inline]
 __se_sys_sendfile64 fs/read_write.c:1417 [inline]
 __x64_sys_sendfile64+0x105/0x150 fs/read_write.c:1417
 x64_sys_call+0x2bb0/0x2ff0 arch/x86/include/generated/asm/syscalls_64.h:41
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0000000000000002 -> 0x0000000000000001

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 5138 Comm: syz.2.401 Not tainted syzkaller #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
==================================================================

Crashes (30):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/19 22:18 upstream b19a97d57c15 254a27c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/08/15 19:22 upstream ee94b00c1a64 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/08/13 08:19 upstream 8742b2d8935f 22ec1469 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/07/31 13:02 upstream 260f6f4fda93 f8f2b4da .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/07/21 11:28 upstream 89be9a83ccf1 56d87229 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/07/21 06:20 upstream 89be9a83ccf1 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/06/19 04:48 upstream fb4d33ab452e ed3e87f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/06/14 16:54 upstream 4774cfe3543a 5f4b362d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/06/10 17:30 upstream f09079bd04a9 5d7e17ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/06/09 10:13 upstream 19272b37aa4f 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/06/08 22:28 upstream 939f15e640f1 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/06/08 22:24 upstream 939f15e640f1 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/06/08 22:24 upstream 939f15e640f1 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/06/08 05:32 upstream 8630c59e9936 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/06/07 17:49 upstream 5b032cac6225 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/06/06 21:29 upstream c0c9379f235d 9fa58bba .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/06/04 10:46 upstream 5abc7438f1e9 e565f08d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/06/03 01:59 upstream fe4281644c62 a30356b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/05/30 09:50 upstream f66bc387efbe 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/05/26 15:38 upstream 0ff41df1cb26 874a1386 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/05/25 08:13 upstream d0c22de9995b ed351ea7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/05/19 13:11 upstream a5806cd506af b84f0537 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/05/18 23:37 upstream a5806cd506af f41472b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/05/17 20:39 upstream 172a9d94339c f41472b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/05/17 03:11 upstream 3c21441eeffc f41472b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/05/13 22:07 upstream 405e6c37c89e 7344edeb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/05/13 21:50 upstream 405e6c37c89e 7344edeb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/03/31 00:28 upstream aa918db707fb d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/03/29 22:18 upstream 7d06015d936c d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
2025/03/29 00:43 upstream 15cb9a2b66fc 9a1a9e31 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / filemap_write_and_wait_range
* Struck through repros no longer work on HEAD.