syzbot


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

Status: moderation: reported on 2025/02/13 02:00
Subsystems: mm fs
[Documentation on labels]
Reported-by: syzbot+b098d0adf79d67bfd69c@syzkaller.appspotmail.com
First crash: 43d, last: 30d
Similar bugs (8)
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 1057d 1095d 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 1317d 1389d 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 389d 452d 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 1015d 1015d 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 1166d 1282d 0/28 auto-closed as invalid on 2022/02/20 21:56
upstream KCSAN: data-race in xas_create / xas_find fs mm 2 1428d 1442d 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 215d 215d 0/28 auto-obsoleted due to no activity on 2024/09/28 12:31
upstream KCSAN: data-race in xas_create / xas_find (8) fs mm 4 137d 164d 0/28 auto-obsoleted due to no activity on 2025/01/05 23:56

Sample crash report:
EXT4-fs: Ignoring removed orlov option
==================================================================
BUG: KCSAN: data-race in xas_create / xas_find

write to 0xffff888104dbdda9 of 1 bytes by task 3375 on cpu 1:
 xas_expand lib/xarray.c:619 [inline]
 xas_create+0x666/0xbd0 lib/xarray.c:660
 xas_store+0x6f/0xc90 lib/xarray.c:794
 __filemap_add_folio+0x3cc/0x6f0 mm/filemap.c:925
 filemap_add_folio+0x9c/0x1b0 mm/filemap.c:981
 page_cache_ra_unbounded+0x1c1/0x350 mm/readahead.c:276
 do_page_cache_ra mm/readahead.c:328 [inline]
 force_page_cache_ra mm/readahead.c:357 [inline]
 page_cache_sync_ra+0x252/0x680 mm/readahead.c:585
 filemap_get_pages+0x2ca/0x11a0 mm/filemap.c:2580
 filemap_read+0x230/0x8c0 mm/filemap.c:2691
 blkdev_read_iter+0x228/0x2d0 block/fops.c:796
 new_sync_read fs/read_write.c:484 [inline]
 vfs_read+0x5cc/0x6f0 fs/read_write.c:565
 ksys_read+0xe8/0x1b0 fs/read_write.c:708
 __do_sys_read fs/read_write.c:717 [inline]
 __se_sys_read fs/read_write.c:715 [inline]
 __x64_sys_read+0x42/0x50 fs/read_write.c:715
 x64_sys_call+0x2874/0x2dc0 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 0xffff888104dbdda9 of 1 bytes by task 3835 on cpu 0:
 xas_find+0x372/0x3f0 lib/xarray.c:1285
 find_get_entry+0x66/0x390 mm/filemap.c:2015
 find_lock_entries+0x412/0x480 mm/filemap.c:2119
 truncate_inode_pages_range+0x138/0x6b0 mm/truncate.c:322
 truncate_inode_pages+0x24/0x30 mm/truncate.c:407
 kill_bdev block/bdev.c:91 [inline]
 set_blocksize+0x25b/0x270 block/bdev.c:172
 sb_set_blocksize block/bdev.c:181 [inline]
 sb_min_blocksize+0x63/0xe0 block/bdev.c:197
 ext4_load_super fs/ext4/super.c:5027 [inline]
 __ext4_fill_super fs/ext4/super.c:5248 [inline]
 ext4_fill_super+0x38b/0x3630 fs/ext4/super.c:5722
 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:5754
 vfs_get_tree+0x56/0x1e0 fs/super.c:1814
 do_new_mount+0x227/0x690 fs/namespace.c:3560
 path_mount+0x49b/0xb30 fs/namespace.c:3887
 do_mount fs/namespace.c:3900 [inline]
 __do_sys_mount fs/namespace.c:4111 [inline]
 __se_sys_mount+0x27f/0x2d0 fs/namespace.c:4088
 __x64_sys_mount+0x67/0x80 fs/namespace.c:4088
 x64_sys_call+0x2c84/0x2dc0 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: 0x21 -> 0x00

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 3835 Comm: syz.1.107 Not tainted 6.14.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
==================================================================
EXT4-fs (loop1): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none.
EXT4-fs error (device loop1): ext4_expand_extra_isize_ea:2793: inode #15: comm syz.1.107: corrupted in-inode xattr: bad magic number in in-inode xattr
EXT4-fs (loop1): Remounting filesystem read-only

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/02/25 10:37 upstream d082ecbc71e9 d34966d1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in xas_create / xas_find
2025/02/13 01:59 upstream 4dc1d1bec898 b27c2402 .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.