syzbot


KCSAN: data-race in fasync_remove_entry / kill_fasync (13)

Status: moderation: reported on 2025/01/14 12:00
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+efbd8ba031ba43118d95@syzkaller.appspotmail.com
First crash: 20h48m, last: 20h48m
Similar bugs (12)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in fasync_remove_entry / kill_fasync (2) fs 1 1605d 1605d 0/28 auto-closed as invalid on 2020/09/27 12:17
upstream KCSAN: data-race in fasync_remove_entry / kill_fasync (10) fs 1 567d 567d 0/28 auto-obsoleted due to no activity on 2023/08/01 22:11
upstream KCSAN: data-race in fasync_remove_entry / kill_fasync (12) fs 1 66d 66d 0/28 auto-obsoleted due to no activity on 2025/01/04 10:04
upstream KCSAN: data-race in fasync_remove_entry / kill_fasync (4) fs 1 1336d 1336d 0/28 auto-closed as invalid on 2021/06/23 11:06
upstream KCSAN: data-race in fasync_remove_entry / kill_fasync (5) fs 2 1267d 1269d 0/28 auto-closed as invalid on 2021/08/31 22:21
upstream KCSAN: data-race in fasync_remove_entry / kill_fasync (9) fs 1 786d 786d 0/28 auto-obsoleted due to no activity on 2023/01/02 11:50
upstream KCSAN: data-race in fasync_remove_entry / kill_fasync (3) fs 1 1488d 1488d 0/28 auto-closed as invalid on 2021/01/22 14:57
upstream KCSAN: data-race in fasync_remove_entry / kill_fasync (11) fs 3 150d 179d 0/28 auto-obsoleted due to no activity on 2024/09/21 19:37
upstream KCSAN: data-race in fasync_remove_entry / kill_fasync (6) fs 1 1206d 1206d 0/28 auto-closed as invalid on 2021/10/31 16:09
upstream KCSAN: data-race in fasync_remove_entry / kill_fasync (7) fs 4 1127d 1166d 0/28 auto-closed as invalid on 2022/01/18 10:05
upstream KCSAN: data-race in fasync_remove_entry / kill_fasync (8) fs 3 1072d 1081d 0/28 auto-closed as invalid on 2022/03/14 14:59
upstream KCSAN: data-race in fasync_remove_entry / kill_fasync fs 82 1659d 1817d 0/28 auto-closed as invalid on 2020/08/04 12:11

Sample crash report:
==================================================================
BUG: KCSAN: data-race in fasync_remove_entry / kill_fasync

write to 0xffff888100627458 of 8 bytes by task 5742 on cpu 1:
 fasync_remove_entry+0xd2/0x130 fs/fcntl.c:1005
 fasync_helper+0x96/0xc0 fs/fcntl.c:1104
 sock_fasync+0x5a/0xc0 net/socket.c:1433
 __fput+0x662/0x6d0 fs/file_table.c:447
 ____fput+0x1c/0x30 fs/file_table.c:478
 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

read to 0xffff888100627458 of 8 bytes by task 5736 on cpu 0:
 kill_fasync+0x24/0x170 fs/fcntl.c:1146
 sock_wake_async+0xf5/0x120
 sk_wake_async include/net/sock.h:2463 [inline]
 unix_release_sock+0x45c/0x750 net/unix/af_unix.c:710
 unix_release+0x57/0x80 net/unix/af_unix.c:1109
 __sock_release net/socket.c:640 [inline]
 sock_close+0x68/0x150 net/socket.c:1408
 __fput+0x17a/0x6d0 fs/file_table.c:450
 ____fput+0x1c/0x30 fs/file_table.c:478
 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: 0xffff8881318fa390 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 5736 Comm: syz.0.747 Not tainted 6.13.0-rc7-syzkaller-00019-gc45323b7560e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/14 11:59 upstream c45323b7560e b1f1cd88 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in fasync_remove_entry / kill_fasync
* Struck through repros no longer work on HEAD.