[moderation] [kernel?] KCSAN: data-race in ktime_get / timekeeping_update_from_shadow

0 views
Skip to first unread message

syzbot

unread,
1:20 AM (2 hours ago) 1:20 AM
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ecc64d2dc9ff Merge tag 'sysctl-7.00-fixes-rc3' of git://gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=175d2b5a580000
kernel config: https://syzkaller.appspot.com/x/.config?x=6b32b22d8934c136
dashboard link: https://syzkaller.appspot.com/bug?extid=e0fb27f89217ad8c3486
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
CC: [jst...@google.com linux-...@vger.kernel.org sb...@kernel.org tg...@kernel.org]

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/955ded1e4b51/disk-ecc64d2d.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/def9de522048/vmlinux-ecc64d2d.xz
kernel image: https://storage.googleapis.com/syzbot-assets/1354202b5017/bzImage-ecc64d2d.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e0fb27...@syzkaller.appspotmail.com

==================================================================
BUG: KCSAN: data-race in ktime_get / timekeeping_update_from_shadow

write to 0xffffffff893c6108 of 280 bytes by interrupt on cpu 1:
timekeeping_update_from_shadow+0x2b4/0x2f0 kernel/time/timekeeping.c:753
__timekeeping_advance+0xa5b/0xbe0 kernel/time/timekeeping.c:2377
timekeeping_advance kernel/time/timekeeping.c:2385 [inline]
update_wall_time+0x24/0x90 kernel/time/timekeeping.c:2395
tick_do_update_jiffies64+0x169/0x1c0 kernel/time/tick-sched.c:149
tick_sched_do_timer kernel/time/tick-sched.c:253 [inline]
tick_nohz_handler+0x8d/0x3d0 kernel/time/tick-sched.c:312
__run_hrtimer kernel/time/hrtimer.c:1785 [inline]
__hrtimer_run_queues+0x218/0x4f0 kernel/time/hrtimer.c:1849
hrtimer_interrupt+0x269/0x810 kernel/time/hrtimer.c:1911
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1045 [inline]
__sysvec_apic_timer_interrupt+0x5f/0x1f0 arch/x86/kernel/apic/apic.c:1062
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
sysvec_apic_timer_interrupt+0x32/0x80 arch/x86/kernel/apic/apic.c:1056
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
preempt_count arch/x86/include/asm/preempt.h:27 [inline]
check_kcov_mode kernel/kcov.c:183 [inline]
write_comp_data kernel/kcov.c:246 [inline]
__sanitizer_cov_trace_const_cmp1+0x17/0x90 kernel/kcov.c:300
br_validate_ipv6+0xf6/0x460 net/bridge/br_netfilter_ipv6.c:58
br_nf_pre_routing_ipv6+0x42/0x2e0 net/bridge/br_netfilter_ipv6.c:169
br_nf_pre_routing+0x52b/0xbd0 net/bridge/br_netfilter_hooks.c:508
nf_hook_entry_hookfn include/linux/netfilter.h:158 [inline]
nf_hook_bridge_pre net/bridge/br_input.c:291 [inline]
br_handle_frame+0x85f/0xa60 net/bridge/br_input.c:442
__netif_receive_skb_core+0x5b1/0x1980 net/core/dev.c:6054
__netif_receive_skb_one_core net/core/dev.c:6165 [inline]
__netif_receive_skb net/core/dev.c:6280 [inline]
process_backlog+0x25b/0x670 net/core/dev.c:6631
__napi_poll+0x61/0x330 net/core/dev.c:7695
napi_poll net/core/dev.c:7758 [inline]
net_rx_action+0x452/0x930 net/core/dev.c:7910
handle_softirqs+0xb9/0x2a0 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0x39/0xc0 kernel/softirq.c:723
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
sysvec_apic_timer_interrupt+0x74/0x80 arch/x86/kernel/apic/apic.c:1056
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
__preempt_count_dec_and_test arch/x86/include/asm/preempt.h:95 [inline]
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:179 [inline]
_raw_spin_unlock_irqrestore+0x1a/0x30 kernel/locking/spinlock.c:194
__unix_dgram_recvmsg+0x3a7/0x860 net/unix/af_unix.c:2596
unix_dgram_recvmsg+0x81/0x90 net/unix/af_unix.c:2670
sock_recvmsg_nosec+0x107/0x130 net/socket.c:1078
____sys_recvmsg+0x26f/0x280 net/socket.c:2810
___sys_recvmsg+0x11f/0x3b0 net/socket.c:2854
do_recvmmsg+0x1ef/0x560 net/socket.c:2949
__sys_recvmmsg net/socket.c:3023 [inline]
__do_sys_recvmmsg net/socket.c:3046 [inline]
__se_sys_recvmmsg net/socket.c:3039 [inline]
__x64_sys_recvmmsg+0xe5/0x170 net/socket.c:3039
x64_sys_call+0x80f/0x3020 arch/x86/include/generated/asm/syscalls_64.h:300
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x12c/0x370 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffffffff893c6118 of 8 bytes by interrupt on cpu 0:
timekeeping_cycles_to_ns kernel/time/timekeeping.c:381 [inline]
timekeeping_get_ns kernel/time/timekeeping.c:404 [inline]
ktime_get+0xcd/0x210 kernel/time/timekeeping.c:826
ktime_get_ns include/linux/timekeeping.h:175 [inline]
tcp_clock_ns include/net/tcp.h:940 [inline]
tcp_mstamp_refresh+0x14/0x70 net/ipv4/tcp_output.c:60
tcp_init_buffer_space net/ipv4/tcp_input.c:749 [inline]
tcp_init_transfer+0x34c/0x5c0 net/ipv4/tcp_input.c:6762
tcp_rcv_state_process+0x178e/0x21a0 net/ipv4/tcp_input.c:7294
tcp_child_process+0x28b/0x430 net/ipv4/tcp_minisocks.c:1004
tcp_v4_rcv+0x1592/0x1db0 net/ipv4/tcp_ipv4.c:2266
ip_protocol_deliver_rcu+0x395/0x790 net/ipv4/ip_input.c:207
ip_local_deliver_finish+0x1fc/0x2f0 net/ipv4/ip_input.c:241
NF_HOOK include/linux/netfilter.h:318 [inline]
ip_local_deliver+0xe8/0x1e0 net/ipv4/ip_input.c:262
dst_input include/net/dst.h:480 [inline]
ip_rcv_finish+0x194/0x1c0 net/ipv4/ip_input.c:453
NF_HOOK include/linux/netfilter.h:318 [inline]
ip_rcv+0x62/0x160 net/ipv4/ip_input.c:573
__netif_receive_skb_one_core net/core/dev.c:6167 [inline]
__netif_receive_skb net/core/dev.c:6280 [inline]
process_backlog+0x341/0x670 net/core/dev.c:6631
__napi_poll+0x61/0x330 net/core/dev.c:7695
napi_poll net/core/dev.c:7758 [inline]
net_rx_action+0x452/0x930 net/core/dev.c:7910
handle_softirqs+0xb9/0x2a0 kernel/softirq.c:622
do_softirq+0x45/0x60 kernel/softirq.c:523
__local_bh_enable_ip+0x70/0x80 kernel/softirq.c:450
local_bh_enable include/linux/bottom_half.h:33 [inline]
rcu_read_unlock_bh include/linux/rcupdate.h:924 [inline]
__dev_queue_xmit+0x136c/0x1f20 net/core/dev.c:4876
dev_queue_xmit include/linux/netdevice.h:3384 [inline]
neigh_hh_output include/net/neighbour.h:540 [inline]
neigh_output include/net/neighbour.h:554 [inline]
ip_finish_output2+0x705/0x8c0 net/ipv4/ip_output.c:237
__ip_finish_output net/ipv4/ip_output.c:-1 [inline]
ip_finish_output+0x114/0x2a0 net/ipv4/ip_output.c:325
NF_HOOK_COND include/linux/netfilter.h:307 [inline]
ip_output+0xbd/0x1c0 net/ipv4/ip_output.c:438
dst_output include/net/dst.h:470 [inline]
ip_local_out net/ipv4/ip_output.c:131 [inline]
__ip_queue_xmit+0xbb0/0xbf0 net/ipv4/ip_output.c:534
ip_queue_xmit+0x39/0x50 net/ipv4/ip_output.c:548
__tcp_transmit_skb+0x1af2/0x1f10 net/ipv4/tcp_output.c:1693
__tcp_send_ack+0x288/0x3b0 net/ipv4/tcp_output.c:4503
tcp_send_ack_reflect_ect+0x61/0x70 net/ipv4/tcp_input.c:4038
tcp_rcv_synsent_state_process net/ipv4/tcp_input.c:7033 [inline]
tcp_rcv_state_process+0x1e26/0x21a0 net/ipv4/tcp_input.c:7227
tcp_v4_do_rcv+0x5fe/0xa30 net/ipv4/tcp_ipv4.c:1909
sk_backlog_rcv include/net/sock.h:1185 [inline]
__release_sock+0x15e/0x2f0 net/core/sock.c:3213
release_sock+0x44/0x150 net/core/sock.c:3795
inet_stream_connect+0x57/0x70 net/ipv4/af_inet.c:751
kernel_connect+0x9f/0xf0 net/socket.c:3634
rds_tcp_conn_path_connect+0x50d/0x5f0 net/rds/tcp_connect.c:205
rds_connect_worker+0x12f/0x1b0 net/rds/threads.c:176
process_one_work kernel/workqueue.c:3275 [inline]
process_scheduled_works+0x4de/0x9e0 kernel/workqueue.c:3358
worker_thread+0x581/0x770 kernel/workqueue.c:3439
kthread+0x22a/0x280 kernel/kthread.c:467
ret_from_fork+0x150/0x360 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

value changed: 0x0000005f0da4e812 -> 0x0000005f0ef4997f

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 70 Comm: kworker/u8:4 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Workqueue: krds_cp_wq#3/0 rds_connect_worker
==================================================================
EXT4-fs (loop1): error count since last fsck: 1
EXT4-fs (loop1): initial error at time 1772691826: ext4_validate_block_bitmap:432
EXT4-fs (loop1): last error at time 1772691826: ext4_validate_block_bitmap:432


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages