syzbot


WARNING: refcount bug in call_timer_fn (4)

Status: moderation: reported on 2025/02/19 09:54
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+8b5e80cec21177f65e1b@syzkaller.appspotmail.com
First crash: 5d19h, last: 5d19h
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: refcount bug in call_timer_fn net 1 1174d 1174d 0/28 closed as invalid on 2022/01/07 18:56
upstream WARNING: refcount bug in call_timer_fn (3) fs 1 105d 101d 0/28 auto-obsoleted due to no activity on 2025/02/05 18:30
upstream WARNING: refcount bug in call_timer_fn (2) acpi 1 199d 195d 0/28 auto-obsoleted due to no activity on 2024/11/03 21:47
linux-6.1 WARNING: refcount bug in call_timer_fn 1 356d 356d 0/3 auto-obsoleted due to no activity on 2024/06/09 18:08

Sample crash report:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 1 PID: 6276 at lib/refcount.c:28 refcount_warn_saturate+0x15a/0x1d0 lib/refcount.c:28
Modules linked in:
CPU: 1 UID: 0 PID: 6276 Comm: syz.3.97 Not tainted 6.14.0-rc1-syzkaller-ga4585442ade5 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
RIP: 0010:refcount_warn_saturate+0x15a/0x1d0 lib/refcount.c:28
Code: e0 b2 80 8c e8 17 7c 8c fc 90 0f 0b 90 90 eb 99 e8 ab b4 cc fc c6 05 7d f2 31 0b 01 90 48 c7 c7 40 b3 80 8c e8 f7 7b 8c fc 90 <0f> 0b 90 90 e9 76 ff ff ff e8 88 b4 cc fc c6 05 57 f2 31 0b 01 90
RSP: 0018:ffffc90000a18b88 EFLAGS: 00010246
RAX: 7d16fa689225ca00 RBX: ffff88814c425020 RCX: ffff88802d5e0000
RDX: 0000000000000100 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000003 R08: ffffffff81817d12 R09: 1ffff9200014310c
R10: dffffc0000000000 R11: fffff5200014310d R12: 1ffff92000143178
R13: ffff88814c4251b8 R14: 0000000000000001 R15: 0000000000000101
FS:  00007f73debfa6c0(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000012784000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000400000000300 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
Call Trace:
 <IRQ>
 call_timer_fn+0x187/0x650 kernel/time/timer.c:1789
 expire_timers kernel/time/timer.c:1840 [inline]
 __run_timers kernel/time/timer.c:2414 [inline]
 __run_timer_base+0x66a/0x8e0 kernel/time/timer.c:2426
 run_timer_base kernel/time/timer.c:2435 [inline]
 run_timer_softirq+0xb7/0x170 kernel/time/timer.c:2445
 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561
 __do_softirq kernel/softirq.c:595 [inline]
 invoke_softirq kernel/softirq.c:435 [inline]
 __irq_exit_rcu+0xf7/0x220 kernel/softirq.c:662
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:678
 instr_sysvec_irq_work arch/x86/kernel/irq_work.c:17 [inline]
 sysvec_irq_work+0xa3/0xc0 arch/x86/kernel/irq_work.c:17
 </IRQ>
 <TASK>
 asm_sysvec_irq_work+0x1a/0x20 arch/x86/include/asm/idtentry.h:738
RIP: 0010:in_lock_functions+0x1e/0x30 kernel/locking/spinlock.c:413
Code: 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 48 c7 c0 90 6f 0a 8c 48 39 c7 0f 93 c0 48 c7 c1 7a a9 0a 8c 48 39 cf 0f 92 c1 <20> c1 0f b6 c1 c3 cc cc cc cc 0f 1f 84 00 00 00 00 00 90 90 90 90
RSP: 0018:ffffc9000c947748 EFLAGS: 00000293
RAX: ffffffff8c0a6f00 RBX: 0000000000000001 RCX: ffffffff8c0aa901
RDX: dffffc0000000000 RSI: ffffffff8228b39f RDI: ffffffff816d1530
RBP: ffffc9000c947878 R08: 0000000000000000 R09: ffffc9000c947930
R10: ffffc9000c947890 R11: ffffffff81ad4540 R12: dffffc0000000000
R13: ffffc9000c947840 R14: ffffffff816d1530 R15: dffffc0000000000
 get_lock_parent_ip include/linux/ftrace.h:1089 [inline]
 preempt_latency_start kernel/sched/core.c:5837 [inline]
 preempt_count_add+0x93/0x190 kernel/sched/core.c:5862
 unwind_next_frame+0xb0/0x22d0 arch/x86/kernel/unwind_orc.c:479
 arch_stack_walk+0x11c/0x150 arch/x86/kernel/stacktrace.c:25
 stack_trace_save+0x118/0x1d0 kernel/stacktrace.c:122
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
 __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394
 kasan_kmalloc include/linux/kasan.h:260 [inline]
 __do_kmalloc_node mm/slub.c:4294 [inline]
 __kmalloc_node_noprof+0x290/0x4d0 mm/slub.c:4300
 kmalloc_node_noprof include/linux/slab.h:928 [inline]
 __bpf_map_area_alloc kernel/bpf/syscall.c:390 [inline]
 bpf_map_area_alloc+0x64/0x120 kernel/bpf/syscall.c:403
 ringbuf_map_alloc+0x188/0x2f0 kernel/bpf/ringbuf.c:201
 map_create+0x946/0x11c0 kernel/bpf/syscall.c:1446
 __sys_bpf+0x6d3/0x820 kernel/bpf/syscall.c:5776
 __do_sys_bpf kernel/bpf/syscall.c:5901 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5899 [inline]
 __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5899
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f73ddd8cde9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f73debfa038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f73ddfa5fa0 RCX: 00007f73ddd8cde9
RDX: 0000000000000048 RSI: 00004000000000c0 RDI: 0000000000000000
RBP: 00007f73dde0e2a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f73ddfa5fa0 R15: 00007fff65389ac8
 </TASK>
----------------
Code disassembly (best guess):
   0:	90                   	nop
   1:	90                   	nop
   2:	90                   	nop
   3:	90                   	nop
   4:	90                   	nop
   5:	90                   	nop
   6:	90                   	nop
   7:	90                   	nop
   8:	90                   	nop
   9:	90                   	nop
   a:	90                   	nop
   b:	90                   	nop
   c:	f3 0f 1e fa          	endbr64
  10:	48 c7 c0 90 6f 0a 8c 	mov    $0xffffffff8c0a6f90,%rax
  17:	48 39 c7             	cmp    %rax,%rdi
  1a:	0f 93 c0             	setae  %al
  1d:	48 c7 c1 7a a9 0a 8c 	mov    $0xffffffff8c0aa97a,%rcx
  24:	48 39 cf             	cmp    %rcx,%rdi
  27:	0f 92 c1             	setb   %cl
* 2a:	20 c1                	and    %al,%cl <-- trapping instruction
  2c:	0f b6 c1             	movzbl %cl,%eax
  2f:	c3                   	ret
  30:	cc                   	int3
  31:	cc                   	int3
  32:	cc                   	int3
  33:	cc                   	int3
  34:	0f 1f 84 00 00 00 00 	nopl   0x0(%rax,%rax,1)
  3b:	00
  3c:	90                   	nop
  3d:	90                   	nop
  3e:	90                   	nop
  3f:	90                   	nop

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/02/15 09:42 bpf-next a4585442ade5 40a34ec9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: refcount bug in call_timer_fn
* Struck through repros no longer work on HEAD.