syzbot


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

Status: moderation: reported on 2024/11/13 01:46
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+d9872a84828ffbbcd8b2@syzkaller.appspotmail.com
First crash: 4d23h, last: 4d23h
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 (2) exfat mm 4 517d 531d 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 (6) mm 4 121d 167d 0/28 auto-obsoleted due to no activity on 2024/08/23 03:22
upstream KCSAN: data-race in __filemap_remove_folio / file_write_and_wait_range (4) mm 2 334d 342d 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 401d 463d 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 81d 81d 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 685d 759d 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 250d 279d 0/28 auto-obsoleted due to no activity on 2024/04/16 09:26

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

read-write to 0xffff8881004c1e70 of 8 bytes by task 21498 on cpu 1:
 page_cache_delete mm/filemap.c:155 [inline]
 __filemap_remove_folio+0x1c5/0x2c0 mm/filemap.c:233
 __remove_mapping+0x33f/0x470 mm/vmscan.c:791
 remove_mapping+0x22/0x90 mm/vmscan.c:824
 mapping_evict_folio mm/truncate.c:277 [inline]
 mapping_try_invalidate+0x266/0x3f0 mm/truncate.c:496
 invalidate_mapping_pages+0x27/0x40 mm/truncate.c:538
 invalidate_bdev+0x58/0x70 block/bdev.c:102
 loop_set_block_size drivers/block/loop.c:1471 [inline]
 lo_simple_ioctl drivers/block/loop.c:1497 [inline]
 lo_ioctl+0xb38/0x11c0 drivers/block/loop.c:1560
 blkdev_ioctl+0x359/0x450 block/ioctl.c:693
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:907 [inline]
 __se_sys_ioctl+0xcd/0x140 fs/ioctl.c:893
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:893
 x64_sys_call+0x15cc/0x2d60 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 0xffff8881004c1e70 of 8 bytes by task 21497 on cpu 0:
 mapping_needs_writeback mm/filemap.c:635 [inline]
 file_write_and_wait_range+0x67/0x250 mm/filemap.c:787
 blkdev_fsync+0x48/0xa0 block/fops.c:555
 vfs_fsync_range+0x116/0x130 fs/sync.c:188
 generic_write_sync+0xec/0x120 include/linux/fs.h:2871
 blkdev_write_iter+0x379/0x3c0 block/fops.c:723
 iter_file_splice_write+0x5f1/0x980 fs/splice.c:743
 do_splice_from fs/splice.c:941 [inline]
 direct_splice_actor+0x160/0x2c0 fs/splice.c:1164
 splice_direct_to_actor+0x302/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+0x39b/0x970 fs/read_write.c:1388
 __do_sys_sendfile64 fs/read_write.c:1455 [inline]
 __se_sys_sendfile64 fs/read_write.c:1441 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1441
 x64_sys_call+0xed5/0x2d60 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: 0x00000000000001b1 -> 0x00000000000001ad

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 21497 Comm: syz.1.6774 Not tainted 6.12.0-rc7-syzkaller-00012-g3022e9d00ebe #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================
I/O error, dev loop7, sector 10624 op 0x1:(WRITE) flags 0x800 phys_seg 16 prio class 0
Buffer I/O error on dev loop7, logical block 1328, lost async page write
Buffer I/O error on dev loop7, logical block 1329, lost async page write
Buffer I/O error on dev loop7, logical block 1330, lost async page write
Buffer I/O error on dev loop7, logical block 1331, lost async page write
Buffer I/O error on dev loop7, logical block 1332, lost async page write
Buffer I/O error on dev loop7, logical block 1333, lost async page write
Buffer I/O error on dev loop7, logical block 1334, lost async page write
Buffer I/O error on dev loop7, logical block 1335, lost async page write
Buffer I/O error on dev loop7, logical block 1336, lost async page write
Buffer I/O error on dev loop7, logical block 1337, lost async page write

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/13 01:45 upstream 3022e9d00ebe 62026c85 .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.