syzbot


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

Status: auto-obsoleted due to no activity on 2024/08/23 03:22
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+52b1ab7b009dee48d2db@syzkaller.appspotmail.com
First crash: 200d, last: 155d
Similar bugs (7)
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 (8) mm 1 38d 38d 0/28 moderation: reported on 2024/11/13 01:46
upstream KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range (2) exfat mm 4 550d 565d 0/28 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 (4) mm 2 367d 375d 0/28 auto-obsoleted due to no activity on 2024/01/23 22:45
upstream KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range (3) mm 5 435d 497d 0/28 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 (7) exfat 1 115d 115d 0/28 auto-obsoleted due to no activity on 2024/10/02 07:50
upstream KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range fs mm 7 719d 793d 0/28 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 284d 313d 0/28 auto-obsoleted due to no activity on 2024/04/16 09:26

Sample crash report:
xt_TCPMSS: Only works on TCP SYN packets
loop7: detected capacity change from 0 to 16384
==================================================================
BUG: KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range

read-write to 0xffff8881006311f0 of 8 bytes by task 5633 on cpu 1:
 page_cache_delete mm/filemap.c:154 [inline]
 __filemap_remove_folio+0x1c5/0x2c0 mm/filemap.c:232
 __remove_mapping+0x33f/0x470 mm/vmscan.c:762
 remove_mapping+0x22/0x90 mm/vmscan.c:795
 mapping_evict_folio mm/truncate.c:293 [inline]
 mapping_try_invalidate+0x288/0x3e0 mm/truncate.c:511
 invalidate_mapping_pages+0x27/0x40 mm/truncate.c:549
 invalidate_bdev+0x58/0x70 block/bdev.c:101
 loop_set_block_size drivers/block/loop.c:1471 [inline]
 lo_simple_ioctl drivers/block/loop.c:1497 [inline]
 lo_ioctl+0xb44/0x11d0 drivers/block/loop.c:1560
 blkdev_ioctl+0x35f/0x450 block/ioctl.c:676
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:907 [inline]
 __se_sys_ioctl+0xd3/0x150 fs/ioctl.c:893
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:893
 x64_sys_call+0x1688/0x2e00 arch/x86/include/generated/asm/syscalls_64.h:17
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff8881006311f0 of 8 bytes by task 5628 on cpu 0:
 mapping_needs_writeback mm/filemap.c:635 [inline]
 file_write_and_wait_range+0x6d/0x170 mm/filemap.c:787
 blkdev_fsync+0x4e/0xa0 block/fops.c:554
 vfs_fsync_range+0x122/0x140 fs/sync.c:188
 generic_write_sync+0xf2/0x130 include/linux/fs.h:2816
 blkdev_write_iter+0x379/0x3c0 block/fops.c:722
 iter_file_splice_write+0x5e6/0x970 fs/splice.c:743
 do_splice_from fs/splice.c:941 [inline]
 direct_splice_actor+0x16c/0x2c0 fs/splice.c:1164
 splice_direct_to_actor+0x305/0x670 fs/splice.c:1108
 do_splice_direct_actor fs/splice.c:1207 [inline]
 do_splice_direct+0xd7/0x150 fs/splice.c:1233
 do_sendfile+0x3ab/0x950 fs/read_write.c:1295
 __do_sys_sendfile64 fs/read_write.c:1362 [inline]
 __se_sys_sendfile64 fs/read_write.c:1348 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1348
 x64_sys_call+0xfc3/0x2e00 arch/x86/include/generated/asm/syscalls_64.h:41
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00000000000001c1 -> 0x00000000000001bd

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 5628 Comm: syz.0.608 Not tainted 6.10.0-syzkaller-08676-g720261cfc732 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
==================================================================
I/O error, dev loop7, sector 7168 op 0x1:(WRITE) flags 0x800 phys_seg 16 prio class 0
Buffer I/O error on dev loop7, logical block 896, lost async page write
Buffer I/O error on dev loop7, logical block 897, lost async page write
Buffer I/O error on dev loop7, logical block 898, lost async page write
Buffer I/O error on dev loop7, logical block 899, lost async page write
Buffer I/O error on dev loop7, logical block 900, lost async page write
Buffer I/O error on dev loop7, logical block 901, lost async page write
Buffer I/O error on dev loop7, logical block 902, lost async page write
Buffer I/O error on dev loop7, logical block 903, lost async page write

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/19 03:22 upstream 720261cfc732 ee4e11c8 .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
2024/07/10 17:28 upstream 34afb82a3c67 6f7fa383 .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
2024/06/21 21:17 upstream 66cc544fd75c edc5149a .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
2024/06/04 01:35 upstream f06ce441457d a1feae05 .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.