syzbot


KCSAN: data-race in xas_create / xas_find (8)

Status: upstream: reported on 2024/10/14 06:08
Subsystems: fs mm
[Documentation on labels]
Reported-by: syzbot+b79be83906cd9bab16ff@syzkaller.appspotmail.com
First crash: 47d, last: 10d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [fs?] [mm?] KCSAN: data-race in xas_create / xas_find (8) 2 (3) 2024/10/14 16:42
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in xas_create / xas_find (4) fs mm 3 930d 968d 0/28 auto-closed as invalid on 2022/06/09 16:26
upstream KCSAN: data-race in xas_create / xas_find (2) fs mm 5 1190d 1262d 0/28 auto-closed as invalid on 2021/09/22 15:56
upstream KCSAN: data-race in xas_create / xas_find (6) fs mm 4 262d 325d 0/28 auto-obsoleted due to no activity on 2024/04/08 00:15
upstream KCSAN: data-race in xas_create / xas_find (5) fs mm 1 888d 888d 0/28 auto-closed as invalid on 2022/07/21 09:43
upstream KCSAN: data-race in xas_create / xas_find (3) mm fs 11 1039d 1155d 0/28 auto-closed as invalid on 2022/02/20 21:56
upstream KCSAN: data-race in xas_create / xas_find fs mm 2 1301d 1315d 0/28 auto-closed as invalid on 2021/06/03 16:29
upstream KCSAN: data-race in xas_create / xas_find (7) fs mm 1 88d 88d 0/28 auto-obsoleted due to no activity on 2024/09/28 12:31

Sample crash report:
EXT4-fs: Ignoring removed mblk_io_submit option
EXT4-fs (loop3): stripe (65535) is not aligned with cluster size (16), stripe is disabled
JBD2: no valid journal superblock found
EXT4-fs (loop3): Could not load journal inode
==================================================================
BUG: KCSAN: data-race in xas_create / xas_find

write to 0xffff888112b0a491 of 1 bytes by task 3393 on cpu 0:
 xas_expand lib/xarray.c:613 [inline]
 xas_create+0x666/0xbd0 lib/xarray.c:654
 xas_store+0x6f/0xc90 lib/xarray.c:788
 __filemap_add_folio+0x3cc/0x6f0 mm/filemap.c:916
 filemap_add_folio+0x9c/0x1b0 mm/filemap.c:972
 page_cache_ra_unbounded+0x175/0x310 mm/readahead.c:268
 do_page_cache_ra mm/readahead.c:320 [inline]
 force_page_cache_ra mm/readahead.c:349 [inline]
 page_cache_sync_ra+0x252/0x670 mm/readahead.c:562
 page_cache_sync_readahead include/linux/pagemap.h:1394 [inline]
 filemap_get_pages+0x2c1/0x10e0 mm/filemap.c:2547
 filemap_read+0x216/0x680 mm/filemap.c:2645
 blkdev_read_iter+0x20e/0x2c0 block/fops.c:765
 new_sync_read fs/read_write.c:488 [inline]
 vfs_read+0x5dc/0x700 fs/read_write.c:569
 ksys_read+0xeb/0x1b0 fs/read_write.c:712
 __do_sys_read fs/read_write.c:722 [inline]
 __se_sys_read fs/read_write.c:720 [inline]
 __x64_sys_read+0x42/0x50 fs/read_write.c:720
 x64_sys_call+0x27d3/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:1
 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 0xffff888112b0a491 of 1 bytes by task 6868 on cpu 1:
 xas_find+0x372/0x3f0 lib/xarray.c:1278
 find_get_entry+0x66/0x390 mm/filemap.c:1992
 find_lock_entries+0x412/0x480 mm/filemap.c:2096
 mapping_try_invalidate+0xb1/0x3f0 mm/truncate.c:484
 invalidate_mapping_pages+0x27/0x40 mm/truncate.c:538
 invalidate_bdev+0x58/0x70 block/bdev.c:102
 __ext4_fill_super fs/ext4/super.c:5661 [inline]
 ext4_fill_super+0x6f3/0x3a10 fs/ext4/super.c:5686
 get_tree_bdev_flags+0x29f/0x310 fs/super.c:1636
 get_tree_bdev+0x1f/0x30 fs/super.c:1659
 ext4_get_tree+0x1c/0x30 fs/ext4/super.c:5718
 vfs_get_tree+0x56/0x1e0 fs/super.c:1814
 do_new_mount+0x227/0x690 fs/namespace.c:3507
 path_mount+0x49b/0xb30 fs/namespace.c:3834
 do_mount fs/namespace.c:3847 [inline]
 __do_sys_mount fs/namespace.c:4057 [inline]
 __se_sys_mount+0x27c/0x2d0 fs/namespace.c:4034
 __x64_sys_mount+0x67/0x80 fs/namespace.c:4034
 x64_sys_call+0x203e/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:166
 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: 0x15 -> 0x00

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 6868 Comm: syz.3.1386 Not tainted 6.12.0-rc6-syzkaller-00318-ga9cda7c0ffed #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/10 23:56 upstream a9cda7c0ffed 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in xas_create / xas_find
2024/11/05 00:50 upstream 557329bcecc2 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in xas_create / xas_find
2024/10/16 11:41 upstream 2f87d0916ce0 bde2d81c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in xas_create / xas_find
2024/10/04 23:49 upstream 2f91ff27b0ee d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in xas_create / xas_find
* Struck through repros no longer work on HEAD.