syzbot


KCSAN: data-race in filemap_flush / xas_set_mark (3)

Status: moderation: reported on 2024/12/09 03:50
Subsystems: mm fs
[Documentation on labels]
Reported-by: syzbot+7764a17262a8bb14bd80@syzkaller.appspotmail.com
First crash: 12d, last: 3d07h
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in filemap_flush / xas_set_mark fs mm 5 1302d 1334d 0/28 auto-closed as invalid on 2021/07/03 02:34
upstream KCSAN: data-race in filemap_flush / xas_set_mark (2) fs mm 20 1069d 1259d 0/28 auto-closed as invalid on 2022/02/21 04:06

Sample crash report:
==================================================================
BUG: KCSAN: data-race in filemap_flush / xas_set_mark

write to 0xffff8881006311a4 of 4 bytes by task 4561 on cpu 1:
 xa_mark_set lib/xarray.c:71 [inline]
 xas_set_mark+0x131/0x150 lib/xarray.c:893
 __folio_start_writeback+0x1e8/0x430 mm/page-writeback.c:3141
 __block_write_full_folio+0x506/0x8c0 fs/buffer.c:1899
 block_write_full_folio+0x293/0x2b0
 write_cache_pages+0x62/0x100 mm/page-writeback.c:2659
 blkdev_writepages+0x59/0x90 block/fops.c:433
 do_writepages+0x1d8/0x480 mm/page-writeback.c:2702
 __writeback_single_inode+0x89/0x850 fs/fs-writeback.c:1680
 writeback_sb_inodes+0x461/0xa30 fs/fs-writeback.c:1976
 __writeback_inodes_wb+0x9a/0x1a0 fs/fs-writeback.c:2047
 wb_writeback+0x274/0x640 fs/fs-writeback.c:2158
 wb_check_background_flush fs/fs-writeback.c:2228 [inline]
 wb_do_writeback fs/fs-writeback.c:2316 [inline]
 wb_workfn+0x67f/0x940 fs/fs-writeback.c:2343
 process_one_work kernel/workqueue.c:3229 [inline]
 process_scheduled_works+0x483/0x9a0 kernel/workqueue.c:3310
 worker_thread+0x51d/0x6f0 kernel/workqueue.c:3391
 kthread+0x1d1/0x210 kernel/kthread.c:389
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

read to 0xffff8881006311a4 of 4 bytes by task 11159 on cpu 0:
 xa_marked include/linux/xarray.h:424 [inline]
 mapping_tagged include/linux/fs.h:504 [inline]
 filemap_fdatawrite_wbc mm/filemap.c:393 [inline]
 __filemap_fdatawrite_range mm/filemap.c:430 [inline]
 __filemap_fdatawrite mm/filemap.c:436 [inline]
 filemap_flush+0x9a/0x120 mm/filemap.c:463
 sync_blockdev_nowait+0x29/0x40 block/bdev.c:207
 sync_filesystem+0xe3/0x190 fs/sync.c:60
 generic_shutdown_super+0x46/0x220 fs/super.c:621
 kill_block_super+0x2a/0x70 fs/super.c:1710
 deactivate_locked_super+0x7d/0x1c0 fs/super.c:473
 deactivate_super+0x9f/0xb0 fs/super.c:506
 cleanup_mnt+0x268/0x2e0 fs/namespace.c:1373
 __cleanup_mnt+0x19/0x20 fs/namespace.c:1380
 task_work_run+0x13a/0x1a0 kernel/task_work.c:239
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0xa8/0x120 kernel/entry/common.c:218
 do_syscall_64+0xd6/0x1c0 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x02000021 -> 0x04000021

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 11159 Comm: syz-executor Not tainted 6.13.0-rc3-syzkaller-00026-g59dbb9d81adf #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/18 06:32 upstream 59dbb9d81adf a0626d3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in filemap_flush / xas_set_mark
2024/12/09 03:50 upstream 62b5a46999c7 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in filemap_flush / xas_set_mark
* Struck through repros no longer work on HEAD.