syzbot


KCSAN: data-race in drop_sysctl_table / proc_sys_revalidate

Status: moderation: reported on 2024/11/20 13:22
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+0f36826deffa40789116@syzkaller.appspotmail.com
First crash: 64d, last: 15d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in drop_sysctl_table / proc_sys_revalidate

write to 0xffff888131ef9818 of 8 bytes by task 10771 on cpu 1:
 start_unregistering fs/proc/proc_sysctl.c:309 [inline]
 drop_sysctl_table+0x97/0x260 fs/proc/proc_sysctl.c:1513
 unregister_sysctl_table+0x30/0x50 fs/proc/proc_sysctl.c:1538
 unregister_net_sysctl_table+0x15/0x20 net/sysctl_net.c:177
 __devinet_sysctl_unregister net/ipv4/devinet.c:2653 [inline]
 devinet_sysctl_unregister net/ipv4/devinet.c:2681 [inline]
 inetdev_destroy net/ipv4/devinet.c:342 [inline]
 inetdev_event+0x614/0xac0 net/ipv4/devinet.c:1663
 notifier_call_chain kernel/notifier.c:85 [inline]
 raw_notifier_call_chain+0x6f/0x1d0 kernel/notifier.c:453
 call_netdevice_notifiers_info+0xae/0x100 net/core/dev.c:1996
 call_netdevice_notifiers_extack net/core/dev.c:2034 [inline]
 call_netdevice_notifiers net/core/dev.c:2048 [inline]
 unregister_netdevice_many_notify+0x8b7/0x11b0 net/core/dev.c:11528
 unregister_netdevice_many net/core/dev.c:11592 [inline]
 unregister_netdevice_queue+0x1f4/0x220 net/core/dev.c:11464
 unregister_netdevice include/linux/netdevice.h:3192 [inline]
 unregister_netdev+0x1c/0x30 net/core/dev.c:11610
 slip_close+0xe5/0x100 drivers/net/slip/slip.c:906
 tty_ldisc_close drivers/tty/tty_ldisc.c:455 [inline]
 tty_ldisc_kill+0x90/0x140 drivers/tty/tty_ldisc.c:613
 tty_ldisc_release+0x13e/0x1d0 drivers/tty/tty_ldisc.c:781
 tty_release_struct+0x1d/0xb0 drivers/tty/tty_io.c:1690
 tty_release+0x8e4/0x930 drivers/tty/tty_io.c:1861
 __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

read to 0xffff888131ef9818 of 8 bytes by task 3037 on cpu 0:
 proc_sys_revalidate+0x49/0x70 fs/proc/proc_sysctl.c:891
 lookup_fast+0x177/0x2a0
 lookup_fast_for_open fs/namei.c:3686 [inline]
 open_last_lookups fs/namei.c:3719 [inline]
 path_openat+0x41e/0x1fa0 fs/namei.c:3984
 do_filp_open+0x107/0x230 fs/namei.c:4014
 do_sys_openat2+0xab/0x120 fs/open.c:1402
 do_sys_open fs/open.c:1417 [inline]
 __do_sys_openat fs/open.c:1433 [inline]
 __se_sys_openat fs/open.c:1428 [inline]
 __x64_sys_openat+0xf3/0x120 fs/open.c:1428
 x64_sys_call+0x2b30/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:258
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0000000000000000 -> 0xffffffffffffffea

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 3037 Comm: dhcpcd Not tainted 6.13.0-rc6-syzkaller-00046-g0b7958fa05d5 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/09 00:49 upstream 0b7958fa05d5 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drop_sysctl_table / proc_sys_revalidate
2024/11/20 13:21 upstream bf9aa14fc523 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drop_sysctl_table / proc_sys_revalidate
* Struck through repros no longer work on HEAD.