syzbot


KCSAN: data-race in ktime_get_real_seconds / timekeeping_update_from_shadow

Status: moderation: reported on 2025/05/02 01:56
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+ff96813529cd8174ae6e@syzkaller.appspotmail.com
First crash: 2d08h, last: 2d08h

Sample crash report:
netdevsim netdevsim4 netdevsim1: set [1, 0] type 2 family 0 port 6081 - 0
netdevsim netdevsim4 netdevsim2: set [1, 0] type 2 family 0 port 6081 - 0
netdevsim netdevsim4 netdevsim3: set [1, 0] type 2 family 0 port 6081 - 0
==================================================================
BUG: KCSAN: data-race in ktime_get_real_seconds / timekeeping_update_from_shadow

write to 0xffffffff88e4e0c8 of 280 bytes by interrupt on cpu 1:
 timekeeping_update_from_shadow+0x280/0x2b0 kernel/time/timekeeping.c:680
 timekeeping_advance+0x9b5/0xb50 kernel/time/timekeeping.c:2208
 update_wall_time+0x10/0x30 kernel/time/timekeeping.c:2219
 tick_do_update_jiffies64+0x169/0x1c0 kernel/time/tick-sched.c:149
 tick_sched_do_timer kernel/time/tick-sched.c:232 [inline]
 tick_nohz_handler+0x7f/0x2d0 kernel/time/tick-sched.c:290
 __run_hrtimer kernel/time/hrtimer.c:1761 [inline]
 __hrtimer_run_queues+0x20c/0x5a0 kernel/time/hrtimer.c:1825
 hrtimer_interrupt+0x21a/0x460 kernel/time/hrtimer.c:1887
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1038 [inline]
 __sysvec_apic_timer_interrupt+0x5c/0x1d0 arch/x86/kernel/apic/apic.c:1055
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
 sysvec_apic_timer_interrupt+0x6f/0x80 arch/x86/kernel/apic/apic.c:1049
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
 should_watch kernel/kcsan/core.c:280 [inline]
 check_access kernel/kcsan/core.c:752 [inline]
 __tsan_read4+0x118/0x190 kernel/kcsan/core.c:1024
 selinux_socket_unix_may_send+0xc6/0x130 security/selinux/hooks.c:5111
 security_unix_may_send+0x40/0x80 security/security.c:4536
 unix_dgram_sendmsg+0x795/0xec0 net/unix/af_unix.c:2105
 sock_sendmsg_nosec net/socket.c:712 [inline]
 __sock_sendmsg+0x142/0x180 net/socket.c:727
 ____sys_sendmsg+0x345/0x4e0 net/socket.c:2566
 ___sys_sendmsg+0x17b/0x1d0 net/socket.c:2620
 __sys_sendmmsg+0x178/0x300 net/socket.c:2709
 __do_sys_sendmmsg net/socket.c:2736 [inline]
 __se_sys_sendmmsg net/socket.c:2733 [inline]
 __x64_sys_sendmmsg+0x57/0x70 net/socket.c:2733
 x64_sys_call+0x2f2f/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:308
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd0/0x1a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffffffff88e4e100 of 8 bytes by task 31391 on cpu 0:
 ktime_get_real_seconds+0x15/0x30 kernel/time/timekeeping.c:939
 mnt_warn_timestamp_expiry+0x9c/0x200 fs/namespace.c:3271
 do_new_mount_fc fs/namespace.c:3819 [inline]
 do_new_mount+0x2f6/0x680 fs/namespace.c:3886
 path_mount+0x4a4/0xb20 fs/namespace.c:4211
 do_mount fs/namespace.c:4224 [inline]
 __do_sys_mount fs/namespace.c:4435 [inline]
 __se_sys_mount+0x28f/0x2e0 fs/namespace.c:4412
 __x64_sys_mount+0x67/0x80 fs/namespace.c:4412
 x64_sys_call+0xd36/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:166
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd0/0x1a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x000000000150a7b9 -> 0x000000000150a7ba

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 31391 Comm: syz-executor Not tainted 6.15.0-rc4-syzkaller-00052-g4f79eaa2ceac #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/02 01:55 upstream 4f79eaa2ceac 51b137cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in ktime_get_real_seconds / timekeeping_update_from_shadow
* Struck through repros no longer work on HEAD.