syzbot


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

Status: moderation: reported on 2024/08/24 12:32
Subsystems: fs mm
[Documentation on labels]
Reported-by: syzbot+e58266c1040c47a90d78@syzkaller.appspotmail.com
First crash: 21d, last: 21d
Similar bugs (6)
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 863d 901d 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 1123d 1195d 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 194d 258d 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 821d 821d 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 971d 1088d 0/28 auto-closed as invalid on 2022/02/20 21:56
upstream KCSAN: data-race in xas_create / xas_find fs mm 2 1234d 1247d 0/28 auto-closed as invalid on 2021/06/03 16:29

Sample crash report:
loop3: detected capacity change from 0 to 1024
EXT4-fs: Ignoring removed oldalloc option
==================================================================
BUG: KCSAN: data-race in xas_create / xas_find

write to 0xffff888106203919 of 1 bytes by task 3243 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+0x3d1/0x710 mm/filemap.c:914
 filemap_add_folio+0x9c/0x1b0 mm/filemap.c:970
 page_cache_ra_unbounded+0x148/0x2e0 mm/readahead.c:252
 do_page_cache_ra mm/readahead.c:303 [inline]
 force_page_cache_ra mm/readahead.c:332 [inline]
 page_cache_sync_ra+0x252/0x670 mm/readahead.c:530
 page_cache_sync_readahead include/linux/pagemap.h:1296 [inline]
 filemap_get_pages+0x252/0xfb0 mm/filemap.c:2529
 filemap_read+0x21c/0x690 mm/filemap.c:2625
 blkdev_read_iter+0x217/0x2c0 block/fops.c:764
 new_sync_read fs/read_write.c:395 [inline]
 vfs_read+0x5e9/0x6e0 fs/read_write.c:476
 ksys_read+0xeb/0x1b0 fs/read_write.c:619
 __do_sys_read fs/read_write.c:629 [inline]
 __se_sys_read fs/read_write.c:627 [inline]
 __x64_sys_read+0x42/0x50 fs/read_write.c:627
 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 0xffff888106203919 of 1 bytes by task 3616 on cpu 1:
 xas_find+0x372/0x3f0 lib/xarray.c:1278
 find_get_entry+0x66/0x390 mm/filemap.c:1990
 find_get_entries+0x9f/0x1f0 mm/filemap.c:2045
 truncate_inode_pages_range+0x4ac/0x6b0 mm/truncate.c:378
 truncate_inode_pages+0x24/0x30 mm/truncate.c:423
 kill_bdev block/bdev.c:90 [inline]
 set_blocksize+0x267/0x280 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:4991 [inline]
 __ext4_fill_super fs/ext4/super.c:5188 [inline]
 ext4_fill_super+0x38b/0x39e0 fs/ext4/super.c:5664
 get_tree_bdev+0x256/0x2e0 fs/super.c:1635
 ext4_get_tree+0x1c/0x30 fs/ext4/super.c:5696
 vfs_get_tree+0x56/0x1d0 fs/super.c:1800
 do_new_mount+0x227/0x690 fs/namespace.c:3472
 path_mount+0x49b/0xb30 fs/namespace.c:3799
 do_mount fs/namespace.c:3812 [inline]
 __do_sys_mount fs/namespace.c:4020 [inline]
 __se_sys_mount+0x27c/0x2d0 fs/namespace.c:3997
 __x64_sys_mount+0x67/0x80 fs/namespace.c:3997
 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: 0x3f -> 0x00

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 3616 Comm: syz.3.54 Not tainted 6.11.0-rc4-syzkaller-00236-g60f0560f53e3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
==================================================================
EXT4-fs (loop3): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none.
EXT4-fs (loop3): shut down requested (0)

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/24 12:31 upstream 60f0560f53e3 d7d32352 .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.