syzbot


WARNING: refcount bug in call_timer_fn (3)

Status: moderation: reported on 2024/11/11 18:37
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+7e2a8e82e0b3db61f681@syzkaller.appspotmail.com
First crash: 10d, last: 10d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: refcount bug in call_timer_fn net 1 1078d 1078d 0/28 closed as invalid on 2022/01/07 18:56
upstream WARNING: refcount bug in call_timer_fn (2) acpi 1 104d 100d 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 261d 261d 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: 0 PID: 6175 at lib/refcount.c:28 refcount_warn_saturate+0x15a/0x1d0 lib/refcount.c:28
Modules linked in:
CPU: 0 UID: 0 PID: 6175 Comm: syz.1.71 Not tainted 6.12.0-rc5-syzkaller-01229-g2a6f99ee1a80 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:refcount_warn_saturate+0x15a/0x1d0 lib/refcount.c:28
Code: 60 bf 60 8c e8 37 96 98 fc 90 0f 0b 90 90 eb 99 e8 8b a0 d7 fc c6 05 83 ca 49 0b 01 90 48 c7 c7 c0 bf 60 8c e8 17 96 98 fc 90 <0f> 0b 90 90 e9 76 ff ff ff e8 68 a0 d7 fc c6 05 5d ca 49 0b 01 90
RSP: 0018:ffffc90000007ba8 EFLAGS: 00010246
RAX: 77cb2991d61d7f00 RBX: ffff88807dd71820 RCX: ffff888026248000
RDX: 0000000000000100 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000003 R08: ffffffff8155d252 R09: fffffbfff1cf9fd0
R10: dffffc0000000000 R11: fffffbfff1cf9fd0 R12: 1ffff92000000f7c
R13: ffff88807dd719b8 R14: 0000000000000001 R15: 0000000000000101
FS:  00007f31a9eba6c0(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200a8030 CR3: 0000000027eb0000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 call_timer_fn+0x18e/0x650 kernel/time/timer.c:1794
 expire_timers kernel/time/timer.c:1845 [inline]
 __run_timers kernel/time/timer.c:2419 [inline]
 __run_timer_base+0x66a/0x8e0 kernel/time/timer.c:2430
 run_timer_base kernel/time/timer.c:2439 [inline]
 run_timer_softirq+0xb7/0x170 kernel/time/timer.c:2449
 handle_softirqs+0x2c5/0x980 kernel/softirq.c:554
 __do_softirq kernel/softirq.c:588 [inline]
 invoke_softirq kernel/softirq.c:428 [inline]
 __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
 sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1049
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:__raw_write_unlock_irq include/linux/rwlock_api_smp.h:274 [inline]
RIP: 0010:_raw_write_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:358
Code: 90 f3 0f 1e fa 53 48 89 fb 48 83 c7 18 48 8b 74 24 08 e8 6a 5a 9d f5 48 89 df e8 c2 b2 9e f5 e8 fd 8c c9 f5 fb bf 01 00 00 00 <e8> 82 1b 90 f5 65 8b 05 b3 c1 30 74 85 c0 74 06 5b c3 cc cc cc cc
RSP: 0018:ffffc900050176b0 EFLAGS: 00000282
RAX: 77cb2991d61d7f00 RBX: ffff888012191940 RCX: ffffffff8170bfba
RDX: dffffc0000000000 RSI: ffffffff8c0acac0 RDI: 0000000000000001
RBP: ffffc900050177d0 R08: ffffffff942db8b7 R09: 1ffffffff285b716
R10: dffffc0000000000 R11: fffffbfff285b717 R12: ffff888012191940
R13: ffffc90005017740 R14: ffff888012191930 R15: dffffc0000000000
 ep_start_scan fs/eventpoll.c:718 [inline]
 __ep_eventpoll_poll+0x3e5/0x970 fs/eventpoll.c:962
 vfs_poll include/linux/poll.h:84 [inline]
 do_pollfd fs/select.c:872 [inline]
 do_poll fs/select.c:920 [inline]
 do_sys_poll+0xa65/0x15e0 fs/select.c:1015
 __do_sys_ppoll fs/select.c:1121 [inline]
 __se_sys_ppoll+0x2a0/0x330 fs/select.c:1101
 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:0x7f31a917e719
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:00007f31a9eba038 EFLAGS: 00000246 ORIG_RAX: 000000000000010f
RAX: ffffffffffffffda RBX: 00007f31a9336130 RCX: 00007f31a917e719
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000020000200
RBP: 00007f31a91f139e R08: 0000000000000003 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f31a9336130 R15: 00007fff3f795418
 </TASK>
----------------
Code disassembly (best guess):
   0:	90                   	nop
   1:	f3 0f 1e fa          	endbr64
   5:	53                   	push   %rbx
   6:	48 89 fb             	mov    %rdi,%rbx
   9:	48 83 c7 18          	add    $0x18,%rdi
   d:	48 8b 74 24 08       	mov    0x8(%rsp),%rsi
  12:	e8 6a 5a 9d f5       	call   0xf59d5a81
  17:	48 89 df             	mov    %rbx,%rdi
  1a:	e8 c2 b2 9e f5       	call   0xf59eb2e1
  1f:	e8 fd 8c c9 f5       	call   0xf5c98d21
  24:	fb                   	sti
  25:	bf 01 00 00 00       	mov    $0x1,%edi
* 2a:	e8 82 1b 90 f5       	call   0xf5901bb1 <-- trapping instruction
  2f:	65 8b 05 b3 c1 30 74 	mov    %gs:0x7430c1b3(%rip),%eax        # 0x7430c1e9
  36:	85 c0                	test   %eax,%eax
  38:	74 06                	je     0x40
  3a:	5b                   	pop    %rbx
  3b:	c3                   	ret
  3c:	cc                   	int3
  3d:	cc                   	int3
  3e:	cc                   	int3
  3f:	cc                   	int3

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/07 18:30 net-next 2a6f99ee1a80 c069283c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in call_timer_fn
* Struck through repros no longer work on HEAD.