syzbot


KCSAN: data-race in free_kthread_struct / kthread_is_per_cpu (2)

Status: auto-closed as invalid on 2022/05/05 08:32
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 272d, last: 251d
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in free_kthread_struct / kthread_is_per_cpu (3) 2 202d 210d 0/24 auto-closed as invalid on 2022/06/23 06:17
upstream KCSAN: data-race in free_kthread_struct / kthread_is_per_cpu 1 313d 313d 0/24 auto-closed as invalid on 2022/03/04 02:39

Sample crash report:
==================================================================
BUG: KCSAN: data-race in free_kthread_struct / kthread_is_per_cpu

write to 0xffff888101ef0a28 of 8 bytes by task 4719 on cpu 1:
 free_kthread_struct+0x5f/0xa0 kernel/kthread.c:143
 begin_new_exec+0xf57/0x1430 fs/exec.c:1312
 load_elf_binary+0x556/0x2560 fs/binfmt_elf.c:1002
 search_binary_handler fs/exec.c:1726 [inline]
 exec_binprm+0x1d9/0x710 fs/exec.c:1767
 bprm_execve+0x3b5/0x520 fs/exec.c:1836
 kernel_execve+0x64e/0x680 fs/exec.c:1997
 call_usermodehelper_exec_async+0x1a6/0x250 kernel/umh.c:112
 ret_from_fork+0x1f/0x30

read to 0xffff888101ef0a28 of 8 bytes by task 1821 on cpu 0:
 __to_kthread kernel/kthread.c:92 [inline]
 kthread_is_per_cpu+0x18/0x80 kernel/kthread.c:606
 can_migrate_task+0xf/0x180 kernel/sched/fair.c:7807
 detach_tasks+0xab/0x3a0 kernel/sched/fair.c:7971
 load_balance+0x7d3/0xcf0 kernel/sched/fair.c:9960
 newidle_balance+0x174/0x350 kernel/sched/fair.c:10969
 pick_next_task_fair+0x37/0x260 kernel/sched/fair.c:7387
 __pick_next_task kernel/sched/core.c:5695 [inline]
 pick_next_task kernel/sched/core.c:6198 [inline]
 __schedule+0x270/0x6c0 kernel/sched/core.c:6346
 schedule+0x71/0xa0 kernel/sched/core.c:6454
 freezable_schedule include/linux/freezer.h:172 [inline]
 do_nanosleep+0xcc/0x3a0 kernel/time/hrtimer.c:2044
 hrtimer_nanosleep+0x10b/0x200 kernel/time/hrtimer.c:2097
 common_nsleep+0x69/0x80 kernel/time/posix-timers.c:1227
 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1267 [inline]
 __se_sys_clock_nanosleep+0x1f1/0x220 kernel/time/posix-timers.c:1245
 __x64_sys_clock_nanosleep+0x51/0x60 kernel/time/posix-timers.c:1245
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x50 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0xffff88811db90780 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 1821 Comm: syz-executor.4 Not tainted 5.17.0-syzkaller-13410-g74164d284b29-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (4):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2022/03/31 08:23 upstream 74164d284b29 9d49f3a7 .config log report info KCSAN: data-race in free_kthread_struct / kthread_is_per_cpu
ci2-upstream-kcsan-gce 2022/03/24 23:31 upstream 52deda9551a0 89bc8608 .config log report info KCSAN: data-race in free_kthread_struct / kthread_is_per_cpu
ci2-upstream-kcsan-gce 2022/03/15 04:15 upstream 09688c0166e7 9e8eaa75 .config log report info KCSAN: data-race in free_kthread_struct / kthread_is_per_cpu
ci2-upstream-kcsan-gce 2022/03/10 11:29 upstream 3bf7edc84a9e 9e8eaa75 .config log report info KCSAN: data-race in free_kthread_struct / kthread_is_per_cpu
* Struck through repros no longer work on HEAD.