syzbot


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

Status: auto-obsoleted due to no activity on 2023/11/17 05:22
Subsystems: mm
[Documentation on labels]
First crash: 488d, last: 426d
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 29d 29d 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 541d 556d 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 146d 191d 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 358d 366d 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 (7) exfat 1 106d 106d 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 710d 784d 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 275d 304d 0/28 auto-obsoleted due to no activity on 2024/04/16 09:26

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

read-write to 0xffff8881005b3130 of 8 bytes by task 5339 on cpu 1:
 page_cache_delete mm/filemap.c:147 [inline]
 __filemap_remove_folio+0x23d/0x330 mm/filemap.c:225
 __remove_mapping+0x341/0x460 mm/vmscan.c:1457
 remove_mapping+0x22/0x90 mm/vmscan.c:1490
 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
 loop_set_block_size drivers/block/loop.c:1494 [inline]
 lo_simple_ioctl drivers/block/loop.c:1522 [inline]
 lo_ioctl+0xd60/0x12e0 drivers/block/loop.c:1585
 blkdev_ioctl+0x375/0x460 block/ioctl.c:630
 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:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

read to 0xffff8881005b3130 of 8 bytes by task 5349 on cpu 0:
 mapping_needs_writeback mm/filemap.c:628 [inline]
 file_write_and_wait_range+0x67/0x190 mm/filemap.c:780
 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:2584
 blkdev_write_iter+0x364/0x390 block/fops.c:688
 do_iter_write+0x4b4/0x7b0 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+0x3b6/0x9a0 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:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x000000000000016e -> 0x0000000000000164

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 5349 Comm: syz-executor.0 Not tainted 6.6.0-rc5-syzkaller-00157-ge8c127b05766 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
==================================================================
I/O error, dev loop7, sector 2936 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 2
Buffer I/O error on dev loop7, logical block 367, lost async page write
I/O error, dev loop7, sector 2928 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 2
Buffer I/O error on dev loop7, logical block 366, lost async page write
I/O error, dev loop7, sector 2920 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 2
Buffer I/O error on dev loop7, logical block 365, lost async page write
I/O error, dev loop7, sector 2912 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 2
Buffer I/O error on dev loop7, logical block 364, lost async page write
Buffer I/O error on dev loop7, logical block 363, lost async page write
Buffer I/O error on dev loop7, logical block 362, lost async page write
Buffer I/O error on dev loop7, logical block 361, lost async page write
Buffer I/O error on dev loop7, logical block 360, lost async page write
Buffer I/O error on dev loop7, logical block 359, lost async page write
Buffer I/O error on dev loop7, logical block 358, lost async page write

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/10/13 05:20 upstream e8c127b05766 6388bc36 .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/09/29 02:21 upstream 9ed22ae6be81 d265efd8 .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/09/02 00:58 upstream b84acc11b1c9 696ea0d2 .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/08/22 22:52 upstream 53663f4103ff b81ca3f6 .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/08/12 02:17 upstream 9106536c1aa3 39990d51 .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.