syzbot


KCSAN: data-race in __filemap_add_folio / invalidate_bdev (10)

Status: moderation: reported on 2025/08/30 18:51
Subsystems: fs mm
[Documentation on labels]
Reported-by: syzbot+a7b8f9378c590dcdf33e@syzkaller.appspotmail.com
First crash: 47d, last: 37d
Similar bugs (9)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __filemap_add_folio / invalidate_bdev fs mm 6 3 1211d 1247d 0/29 auto-closed as invalid on 2022/07/28 00:49
upstream KCSAN: data-race in __filemap_add_folio / invalidate_bdev (4) fs mm 6 4 788d 819d 0/29 auto-obsoleted due to no activity on 2023/09/24 05:15
upstream KCSAN: data-race in __filemap_add_folio / invalidate_bdev (5) fs mm 6 4 654d 674d 0/29 auto-obsoleted due to no activity on 2024/02/05 20:23
upstream KCSAN: data-race in __filemap_add_folio / invalidate_bdev (3) block 6 1 913d 906d 0/29 auto-obsoleted due to no activity on 2023/05/21 22:53
upstream KCSAN: data-race in __filemap_add_folio / invalidate_bdev (2) mm fs 6 2 1115d 1141d 0/29 auto-obsoleted due to no activity on 2022/11/01 13:37
upstream KCSAN: data-race in __filemap_add_folio / invalidate_bdev (8) mm fs 6 2 216d 220d 0/29 auto-obsoleted due to no activity on 2025/05/09 19:21
upstream KCSAN: data-race in __filemap_add_folio / invalidate_bdev (9) mm fs 6 1 113d 113d 0/29 auto-obsoleted due to no activity on 2025/08/20 03:26
upstream KCSAN: data-race in __filemap_add_folio / invalidate_bdev (6) fs mm 6 1 571d 571d 0/29 auto-obsoleted due to no activity on 2024/04/28 09:19
upstream KCSAN: data-race in __filemap_add_folio / invalidate_bdev (7) fs mm 6 1 323d 323d 0/29 auto-obsoleted due to no activity on 2025/01/22 09:36

Sample crash report:
loop1: detected capacity change from 0 to 512
==================================================================
BUG: KCSAN: data-race in __filemap_add_folio / invalidate_bdev

read-write to 0xffff8881005f0bb8 of 8 bytes by task 3293 on cpu 0:
 __filemap_add_folio+0x5b9/0x7d0 mm/filemap.c:928
 filemap_add_folio+0x98/0x1b0 mm/filemap.c:969
 page_cache_ra_unbounded+0x1f3/0x380 mm/readahead.c:275
 do_page_cache_ra mm/readahead.c:327 [inline]
 force_page_cache_ra mm/readahead.c:356 [inline]
 page_cache_sync_ra+0x256/0x6c0 mm/readahead.c:572
 filemap_get_pages+0x2d0/0x1150 mm/filemap.c:2603
 filemap_read+0x231/0xa00 mm/filemap.c:2712
 blkdev_read_iter+0x22d/0x2e0 block/fops.c:852
 new_sync_read fs/read_write.c:491 [inline]
 vfs_read+0x64c/0x770 fs/read_write.c:572
 ksys_read+0xda/0x1a0 fs/read_write.c:715
 __do_sys_read fs/read_write.c:724 [inline]
 __se_sys_read fs/read_write.c:722 [inline]
 __x64_sys_read+0x40/0x50 fs/read_write.c:722
 x64_sys_call+0x27bc/0x2ff0 arch/x86/include/generated/asm/syscalls_64.h:1
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff8881005f0bb8 of 8 bytes by task 4203 on cpu 1:
 invalidate_bdev+0x25/0x70 block/bdev.c:99
 bdev_disk_changed+0xeb/0xcb0 block/partitions/core.c:657
 blkdev_get_whole+0x1f5/0x2d0 block/bdev.c:748
 bdev_open+0x280/0x7e0 block/bdev.c:957
 bdev_file_open_by_dev+0x1e6/0x250 block/bdev.c:1059
 setup_bdev_super+0x46/0x370 fs/super.c:1610
 get_tree_bdev_flags+0x21c/0x300 fs/super.c:1690
 get_tree_bdev+0x1f/0x30 fs/super.c:1715
 ext4_get_tree+0x1c/0x30 fs/ext4/super.c:5760
 vfs_get_tree+0x57/0x1d0 fs/super.c:1815
 do_new_mount+0x207/0x5e0 fs/namespace.c:3808
 path_mount+0x4a4/0xb20 fs/namespace.c:4123
 do_mount fs/namespace.c:4136 [inline]
 __do_sys_mount fs/namespace.c:4347 [inline]
 __se_sys_mount+0x28f/0x2e0 fs/namespace.c:4324
 __x64_sys_mount+0x67/0x80 fs/namespace.c:4324
 x64_sys_call+0x2b4d/0x2ff0 arch/x86/include/generated/asm/syscalls_64.h:166
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0000000000000000 -> 0x0000000000000001

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 4203 Comm: syz.1.216 Not tainted syzkaller #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
==================================================================
EXT4-fs error (device loop1): ext4_orphan_get:1418: comm syz.1.216: bad orphan inode 11862016
EXT4-fs (loop1): mounted filesystem 00000000-0000-0000-0000-000000d40000 r/w without journal. Quota mode: writeback.
ext4 filesystem being mounted at /44/file1 supports timestamps until 2038-01-19 (0x7fffffff)

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/09 00:26 upstream f777d1112ee5 d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_add_folio / invalidate_bdev
2025/08/30 18:50 upstream 11e7861d680c 807a3b61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __filemap_add_folio / invalidate_bdev
* Struck through repros no longer work on HEAD.