syzbot


KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr

Status: fixed on 2023/07/01 16:05
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+4a06d4373fd52f0b2f9c@syzkaller.appspotmail.com
Fix commit: c915d8f5918b inotify: Avoid reporting event with invalid wd
First crash: 1211d, last: 349d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] inotify: Avoid reporting event with invalid wd 3 (3) 2023/04/25 10:38
[syzbot] [fs?] KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr 2 (3) 2023/04/24 13:54

Sample crash report:
loop1: detected capacity change from 0 to 256
==================================================================
BUG: KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr

write to 0xffff88810396ff48 of 4 bytes by task 8000 on cpu 1:
 inotify_remove_from_idr+0x106/0x310 fs/notify/inotify/inotify_user.c:511
 inotify_ignored_and_remove_idr+0x34/0x60 fs/notify/inotify/inotify_user.c:532
 inotify_freeing_mark+0x1d/0x30 fs/notify/inotify/inotify_fsnotify.c:133
 fsnotify_free_mark fs/notify/mark.c:490 [inline]
 fsnotify_destroy_mark+0x17a/0x190 fs/notify/mark.c:499
 __do_sys_inotify_rm_watch fs/notify/inotify/inotify_user.c:817 [inline]
 __se_sys_inotify_rm_watch+0xf7/0x170 fs/notify/inotify/inotify_user.c:794
 __x64_sys_inotify_rm_watch+0x31/0x40 fs/notify/inotify/inotify_user.c:794
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

read to 0xffff88810396ff48 of 4 bytes by task 9356 on cpu 0:
 inotify_handle_inode_event+0x17e/0x2c0 fs/notify/inotify/inotify_fsnotify.c:113
 fsnotify_handle_inode_event+0x19b/0x1f0 fs/notify/fsnotify.c:264
 fsnotify_handle_event fs/notify/fsnotify.c:316 [inline]
 send_to_group fs/notify/fsnotify.c:364 [inline]
 fsnotify+0x101c/0x1150 fs/notify/fsnotify.c:570
 __fsnotify_parent+0x307/0x480 fs/notify/fsnotify.c:230
 fsnotify_parent include/linux/fsnotify.h:77 [inline]
 fsnotify_file include/linux/fsnotify.h:99 [inline]
 fsnotify_close include/linux/fsnotify.h:341 [inline]
 __fput+0x4b0/0x570 fs/file_table.c:307
 ____fput+0x15/0x20 fs/file_table.c:349
 task_work_run+0x135/0x1a0 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xd1/0xe0 kernel/entry/common.c:171
 exit_to_user_mode_prepare+0x6c/0xb0 kernel/entry/common.c:204
 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
 syscall_exit_to_user_mode+0x26/0x140 kernel/entry/common.c:297
 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x00000726 -> 0xffffffff

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 9356 Comm: syz-executor.1 Not tainted 6.3.0-syzkaller-13505-g17784de648be #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
==================================================================

Crashes (363):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/08 06:36 upstream 17784de648be 90c93c40 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/05/05 14:58 upstream 78b421b6a7c6 518a39a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/05/04 09:27 upstream fa31fc82fb77 5b7ff9dd .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/05/03 17:55 upstream 348551ddaf31 b5918830 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/30 21:41 upstream 825a0714d2b3 62df2017 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/30 03:28 upstream 1ae78a14516b 62df2017 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/29 14:15 upstream 89d77f71f493 62df2017 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/28 14:32 upstream 35fab9271b7e 70a605de .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/27 17:26 upstream 6e98b09da931 6f3d6fa7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/27 06:38 upstream 5c7ecada25d2 19a3dabe .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/26 11:24 upstream 0cfd8703e7da 8d843721 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/25 17:58 upstream 173ea743bf7a 65320f8e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/25 11:52 upstream 1a0beef98b58 65320f8e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/23 13:25 upstream 622322f53c6d 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/22 21:23 upstream 2caeeb9d4a1b 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/21 19:07 upstream 2af3e53a4dc0 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/21 01:50 upstream 6a66fdd29ea1 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/20 13:45 upstream cb0856346a60 a219f34e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/20 04:19 upstream 789b4a41c247 a219f34e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/17 23:36 upstream 6a8f57ae2eb0 436577a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/17 14:36 upstream 6a8f57ae2eb0 c6ec7083 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/16 15:38 upstream 3e7bb4f24617 ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/16 00:48 upstream a7a55e27ad72 ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/15 06:47 upstream 95abc817ab3a ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/12 02:47 upstream e62252bc55b6 49faf98d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/11 14:51 upstream 0d3eb744aed4 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/10 09:47 upstream 09a9639e56c0 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/07 16:48 upstream f2afccfefe7b f7ba566d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/06 03:14 upstream 99ddf2254feb 8b834965 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/05 04:57 upstream 76f598ba7d8e 831373d3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/04 03:56 upstream 148341f0a2f5 41147e3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/03 16:47 upstream 7e364e56293b 41147e3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/04/02 16:28 upstream 00c7b5f4ddc5 f325deb0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/03/30 06:20 upstream ffe78bbd5121 f325deb0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/03/27 07:59 upstream 0ec57cfa721f fbf0499a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/03/24 11:36 upstream 1e760fa3596e f94b4a29 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/03/21 15:21 upstream 17214b70a159 7939252e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/03/19 22:19 upstream a3671bd86a97 7939252e .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/03/16 08:26 upstream 9c1bec9c0b08 18b58603 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/03/14 17:13 upstream fc89d7fb499b 0d5c4377 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/03/12 07:12 upstream 81ff855485a3 5205ef30 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/03/09 18:04 upstream 6a98c9cae232 f08b59ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/03/09 05:52 upstream 6a98c9cae232 4fc6d98d .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/02/15 20:42 upstream e1c04510f521 6be0f1f5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2023/02/09 17:48 upstream 0983f6bf2bfc 07980f9d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2021/06/14 13:11 upstream 009c9aa5be65 1ba81399 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2021/06/12 13:57 upstream ad347abe4a98 1ba81399 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in inotify_handle_inode_event / inotify_remove_from_idr
2020/12/27 19:20 upstream f838f8d2b694 2242f77f .config console log report info ci2-upstream-kcsan-gce
* Struck through repros no longer work on HEAD.