syzbot


KCSAN: data-race in fsnotify_detach_mark / fsnotify_handle_inode_event (4)

Status: moderation: reported on 2025/05/29 06:50
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+21ccf00ef85c17ca9d58@syzkaller.appspotmail.com
First crash: 51d, last: 7d05h
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in fsnotify_detach_mark / fsnotify_handle_inode_event (3) fs 6 24 164d 323d 0/29 auto-obsoleted due to no activity on 2025/04/01 19:34
upstream KCSAN: data-race in fsnotify_detach_mark / fsnotify_handle_inode_event (2) fs 6 3 369d 377d 0/29 auto-obsoleted due to no activity on 2024/08/19 04:23
upstream KCSAN: data-race in fsnotify_detach_mark / fsnotify_handle_inode_event fs 6 226 454d 589d 0/29 auto-obsoleted due to no activity on 2024/05/18 20:42

Sample crash report:
loop2: detected capacity change from 0 to 512
==================================================================
BUG: KCSAN: data-race in fsnotify_detach_mark / fsnotify_handle_inode_event

write to 0xffff888103f05e54 of 4 bytes by task 3700 on cpu 1:
 fsnotify_detach_mark+0xba/0x160 fs/notify/mark.c:554
 fsnotify_destroy_mark+0x70/0x150 fs/notify/mark.c:596
 __do_sys_inotify_rm_watch fs/notify/inotify/inotify_user.c:805 [inline]
 __se_sys_inotify_rm_watch+0xe8/0x170 fs/notify/inotify/inotify_user.c:786
 __x64_sys_inotify_rm_watch+0x31/0x40 fs/notify/inotify/inotify_user.c:786
 x64_sys_call+0x1fe9/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:256
 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 0xffff888103f05e54 of 4 bytes by task 5761 on cpu 0:
 fsnotify_handle_inode_event+0x125/0x220 fs/notify/fsnotify.c:313
 fsnotify_handle_event fs/notify/fsnotify.c:376 [inline]
 send_to_group fs/notify/fsnotify.c:424 [inline]
 fsnotify+0x13c9/0x14b0 fs/notify/fsnotify.c:641
 __fsnotify_parent+0x2ed/0x330 fs/notify/fsnotify.c:287
 fsnotify_parent include/linux/fsnotify.h:96 [inline]
 fsnotify_path include/linux/fsnotify.h:113 [inline]
 fsnotify_file include/linux/fsnotify.h:127 [inline]
 fsnotify_close include/linux/fsnotify.h:482 [inline]
 __fput+0x1de/0x650 fs/file_table.c:451
 fput_close_sync+0x6e/0x120 fs/file_table.c:570
 __do_sys_close fs/open.c:1589 [inline]
 __se_sys_close fs/open.c:1574 [inline]
 __x64_sys_close+0x56/0xf0 fs/open.c:1574
 x64_sys_call+0x2747/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:4
 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: 0x00000003 -> 0x00000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 5761 Comm: syz.2.576 Not tainted 6.16.0-rc5-syzkaller-00224-g379f604cc3dc #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
==================================================================
EXT4-fs (loop2): 1 orphan inode deleted
EXT4-fs (loop2): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: writeback.

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/12 09:03 upstream 379f604cc3dc 3cda49cf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in fsnotify_detach_mark / fsnotify_handle_inode_event
2025/06/30 08:24 upstream d0b3b7b22dfa fc9d8ee5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in fsnotify_detach_mark / fsnotify_handle_inode_event
2025/06/27 17:47 upstream 67a993863163 803ce19b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in fsnotify_detach_mark / fsnotify_handle_inode_event
2025/06/25 03:37 upstream 7595b66ae9de 26d77996 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in fsnotify_detach_mark / fsnotify_handle_inode_event
2025/05/29 06:49 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in fsnotify_detach_mark / fsnotify_handle_inode_event
* Struck through repros no longer work on HEAD.