syzbot


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

Status: auto-obsoleted due to no activity on 2024/01/23 22:45
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+78a4549691c135a19330@syzkaller.appspotmail.com
First crash: 244d, last: 214d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range (2) exfat mm 4 397d 412d 0/27 auto-obsoleted due to no activity on 2023/07/24 21:47
upstream KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range (6) mm iomap 4 2d03h 47d 0/27 moderation: reported on 2024/06/04 01:36
upstream KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range (3) mm 5 282d 344d 0/27 auto-obsoleted due to no activity on 2023/11/17 05:22
upstream KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range fs mm 7 566d 640d 0/27 auto-obsoleted due to no activity on 2023/02/28 04:15
upstream KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range (5) mm 4 130d 159d 0/27 auto-obsoleted due to no activity on 2024/04/16 09:26

Sample crash report:
loop7: detected capacity change from 0 to 16384
==================================================================
BUG: KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range

read-write to 0xffff8881004c1e70 of 8 bytes by task 26999 on cpu 0:
 page_cache_delete mm/filemap.c:144 [inline]
 __filemap_remove_folio+0x1d1/0x2d0 mm/filemap.c:222
 __remove_mapping+0x341/0x460 mm/vmscan.c:756
 remove_mapping+0x22/0x90 mm/vmscan.c:789
 mapping_evict_folio mm/truncate.c:281 [inline]
 mapping_try_invalidate+0x286/0x3d0 mm/truncate.c:520
 invalidate_mapping_pages+0x27/0x30 mm/truncate.c:558
 invalidate_bdev+0x65/0x70 block/bdev.c:87
 bdev_disk_changed+0x118/0xc70 block/partitions/core.c:664
 loop_reread_partitions drivers/block/loop.c:518 [inline]
 loop_set_status+0x4ab/0x550 drivers/block/loop.c:1322
 lo_ioctl+0x892/0x12e0
 blkdev_ioctl+0x375/0x460 block/ioctl.c:633
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl+0xcf/0x140 fs/ioctl.c:857
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

read to 0xffff8881004c1e70 of 8 bytes by task 26987 on cpu 1:
 mapping_needs_writeback mm/filemap.c:625 [inline]
 file_write_and_wait_range+0x67/0x190 mm/filemap.c:777
 blkdev_fsync+0x4e/0xa0 block/fops.c:529
 vfs_fsync_range+0x111/0x120 fs/sync.c:188
 generic_write_sync+0xf2/0x120 include/linux/fs.h:2653
 blkdev_write_iter+0x364/0x390 block/fops.c:700
 do_iter_write+0x4ad/0x770 fs/read_write.c:860
 vfs_iter_write+0x56/0x70 fs/read_write.c:901
 iter_file_splice_write+0x462/0x7e0 fs/splice.c:736
 do_splice_from fs/splice.c:933 [inline]
 direct_splice_actor+0x8a/0xb0 fs/splice.c:1142
 splice_direct_to_actor+0x31d/0x690 fs/splice.c:1088
 do_splice_direct+0x10d/0x190 fs/splice.c:1194
 do_sendfile+0x3c4/0x980 fs/read_write.c:1254
 __do_sys_sendfile64 fs/read_write.c:1322 [inline]
 __se_sys_sendfile64 fs/read_write.c:1308 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1308
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

value changed: 0x00000000000001e2 -> 0x00000000000001d9

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 26987 Comm: syz-executor.2 Not tainted 6.7.0-rc6-syzkaller-00022-g55cb5f43689d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
==================================================================
I/O error, dev loop7, sector 3712 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 2

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/19 22:44 upstream 55cb5f43689d 3ad490ea .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range
2023/11/20 00:14 upstream eb3479bc23fa cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range
* Struck through repros no longer work on HEAD.