syzbot


KCSAN: data-race in xas_find_marked / xas_init_marks (3)

Status: auto-obsoleted due to no activity on 2024/09/27 13:38
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+bbc8801913eaf3bc93b4@syzkaller.appspotmail.com
First crash: 44d, last: 44d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in xas_find_marked / xas_init_marks (2) ext4 820 76d 1224d 0/28 auto-obsoleted due to no activity on 2024/08/19 12:59
upstream KCSAN: data-race in xas_find_marked / xas_init_marks ext4 11 1446d 1536d 0/28 auto-closed as invalid on 2020/11/26 04:55

Sample crash report:
loop3: detected capacity change from 0 to 2048
==================================================================
BUG: KCSAN: data-race in xas_find_marked / xas_init_marks

read-write to 0xffff888106810480 of 8 bytes by task 5155 on cpu 0:
 instrument_read_write include/linux/instrumented.h:55 [inline]
 __instrument_read_write_bitop include/asm-generic/bitops/instrumented-non-atomic.h:84 [inline]
 ___test_and_clear_bit include/asm-generic/bitops/instrumented-non-atomic.h:114 [inline]
 node_clear_mark lib/xarray.c:102 [inline]
 xas_clear_mark lib/xarray.c:915 [inline]
 xas_init_marks+0x17e/0x320 lib/xarray.c:948
 xas_store+0x213/0xc90 lib/xarray.c:810
 page_cache_delete_batch mm/filemap.c:321 [inline]
 delete_from_page_cache_batch+0x31c/0x700 mm/filemap.c:343
 truncate_inode_pages_range+0x1c5/0x6b0 mm/truncate.c:343
 truncate_inode_pages mm/truncate.c:423 [inline]
 truncate_pagecache+0x53/0x70 mm/truncate.c:727
 ext4_setattr+0xa07/0xeb0 fs/ext4/inode.c:5520
 notify_change+0x814/0x8a0 fs/attr.c:495
 do_truncate+0x116/0x160 fs/open.c:65
 handle_truncate fs/namei.c:3381 [inline]
 do_open fs/namei.c:3731 [inline]
 path_openat+0x1b5c/0x1f10 fs/namei.c:3886
 do_filp_open+0xf7/0x200 fs/namei.c:3913
 do_sys_openat2+0xab/0x120 fs/open.c:1416
 do_sys_open fs/open.c:1431 [inline]
 __do_sys_open fs/open.c:1439 [inline]
 __se_sys_open fs/open.c:1435 [inline]
 __x64_sys_open+0xe6/0x110 fs/open.c:1435
 x64_sys_call+0x1321/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:3
 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 0xffff888106810480 of 8 bytes by task 5136 on cpu 1:
 xas_find_chunk include/linux/xarray.h:1733 [inline]
 xas_find_marked+0x216/0x660 lib/xarray.c:1370
 find_get_entry+0x54/0x390 mm/filemap.c:1992
 filemap_get_folios_tag+0x136/0x210 mm/filemap.c:2242
 mpage_prepare_extent_to_map+0x329/0xb80 fs/ext4/inode.c:2466
 ext4_do_writepages+0x6ea/0x2110 fs/ext4/inode.c:2706
 ext4_writepages+0x159/0x2e0 fs/ext4/inode.c:2842
 do_writepages+0x1d8/0x480 mm/page-writeback.c:2683
 filemap_fdatawrite_wbc+0xdb/0x100 mm/filemap.c:397
 __filemap_fdatawrite_range mm/filemap.c:430 [inline]
 file_write_and_wait_range+0xc8/0x170 mm/filemap.c:788
 generic_buffers_fsync_noflush+0x4c/0x130 fs/buffer.c:600
 ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline]
 ext4_sync_file+0x20b/0x6c0 fs/ext4/fsync.c:151
 vfs_fsync_range+0x122/0x140 fs/sync.c:188
 generic_write_sync include/linux/fs.h:2821 [inline]
 ext4_buffered_write_iter+0x338/0x380 fs/ext4/file.c:305
 ext4_file_write_iter+0x29f/0xe30
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0x78f/0x900 fs/read_write.c:590
 ksys_write+0xeb/0x1b0 fs/read_write.c:643
 __do_sys_write fs/read_write.c:655 [inline]
 __se_sys_write fs/read_write.c:652 [inline]
 __x64_sys_write+0x42/0x50 fs/read_write.c:652
 x64_sys_call+0x27dd/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:2
 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: 0xffffffffffffffff -> 0xfffffffffffffff0

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 5136 Comm: syz.3.588 Not tainted 6.11.0-rc4-syzkaller-00143-g3d5f968a177d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/23 13:38 upstream 3d5f968a177d d7d32352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in xas_find_marked / xas_init_marks
* Struck through repros no longer work on HEAD.