syzbot


WARNING: refcount bug in delayed_put_task_struct

Status: upstream: reported syz repro on 2025/06/18 12:56
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+fb194529d2cbbf9f1467@syzkaller.appspotmail.com
First crash: 23h01m, last: 16h17m
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [kernel?] WARNING: refcount bug in delayed_put_task_struct 0 (1) 2025/06/18 12:56

Sample crash report:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 1 PID: 6673 at lib/refcount.c:28 refcount_warn_saturate+0x14a/0x210 lib/refcount.c:28
Modules linked in:
CPU: 1 UID: 0 PID: 6673 Comm: kworker/u8:12 Not tainted 6.16.0-rc2-syzkaller-00045-g4663747812d1 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: events_unbound nsim_dev_trap_report_work
RIP: 0010:refcount_warn_saturate+0x14a/0x210 lib/refcount.c:28
Code: ff 89 de e8 a8 e3 e2 fc 84 db 0f 85 66 ff ff ff e8 bb e8 e2 fc c6 05 a9 f1 b7 0b 01 90 48 c7 c7 a0 0f 15 8c e8 67 00 a2 fc 90 <0f> 0b 90 90 e9 43 ff ff ff e8 98 e8 e2 fc 0f b6 1d 84 f1 b7 0b 31
RSP: 0018:ffffc90000a08dd8 EFLAGS: 00010286

RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff817aa1a8
RDX: ffff88802e90da00 RSI: ffffffff817aa1b5 RDI: 0000000000000001
RBP: ffff88805ae68028 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 000000000008e038 R12: ffff88805ae68000
R13: ffff88805ae68028 R14: ffffc90000a08e90 R15: 0000000000000004
FS:  0000000000000000(0000) GS:ffff888124861000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8ed0a91f98 CR3: 0000000077b4c000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 __refcount_sub_and_test include/linux/refcount.h:400 [inline]
 __refcount_dec_and_test include/linux/refcount.h:432 [inline]
 refcount_dec_and_test include/linux/refcount.h:450 [inline]
 put_task_struct include/linux/sched/task.h:134 [inline]
 delayed_put_task_struct+0x239/0x2e0 kernel/exit.c:230
 rcu_do_batch kernel/rcu/tree.c:2576 [inline]
 rcu_core+0x799/0x14e0 kernel/rcu/tree.c:2832
 handle_softirqs+0x216/0x8e0 kernel/softirq.c:579
 __do_softirq kernel/softirq.c:613 [inline]
 invoke_softirq kernel/softirq.c:453 [inline]
 __irq_exit_rcu+0x109/0x170 kernel/softirq.c:680
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline]
 sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1050
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:kasan_quarantine_put+0x97/0x240 mm/kasan/quarantine.c:237
Code: 00 00 00 00 00 48 03 5a 10 48 89 5a 10 48 81 fb 00 00 10 00 0f 87 94 00 00 00 4d 85 ed 75 79 9c 58 f6 c4 02 0f 85 6d 01 00 00 <5b> b8 01 00 00 00 5d 41 5c 41 5d 41 5e e9 47 b4 5d 09 e8 82 db a1
RSP: 0018:ffffc9000b4c7ac0 EFLAGS: 00000246
RAX: 0000000000000006 RBX: 000000000009b258 RCX: 0000000000000006
RDX: 0000000000000000 RSI: ffffffff8de13aed RDI: ffffffff8c1563e0
RBP: ffff8880362b4640 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff90a83057 R11: 0000000000002c00 R12: ffff88801fea08c0
R13: 0000000000000200 R14: ffffea0000d8ad00 R15: 0000000000000000
 kasan_slab_free include/linux/kasan.h:233 [inline]
 slab_free_hook mm/slub.c:2381 [inline]
 slab_free mm/slub.c:4643 [inline]
 kmem_cache_free+0x2d1/0x4d0 mm/slub.c:4745
 kfree_skbmem+0x1a4/0x1f0 net/core/skbuff.c:1110
 __kfree_skb net/core/skbuff.c:1167 [inline]
 consume_skb net/core/skbuff.c:1398 [inline]
 consume_skb+0xcc/0x100 net/core/skbuff.c:1392
 nsim_dev_trap_report drivers/net/netdevsim/dev.c:821 [inline]
 nsim_dev_trap_report_work+0x8bd/0xcf0 drivers/net/netdevsim/dev.c:851
 process_one_work+0x9cc/0x1b70 kernel/workqueue.c:3238
 process_scheduled_works kernel/workqueue.c:3321 [inline]
 worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402
 kthread+0x3c5/0x780 kernel/kthread.c:464
 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>
----------------
Code disassembly (best guess):
   0:	00 00                	add    %al,(%rax)
   2:	00 00                	add    %al,(%rax)
   4:	00 48 03             	add    %cl,0x3(%rax)
   7:	5a                   	pop    %rdx
   8:	10 48 89             	adc    %cl,-0x77(%rax)
   b:	5a                   	pop    %rdx
   c:	10 48 81             	adc    %cl,-0x7f(%rax)
   f:	fb                   	sti
  10:	00 00                	add    %al,(%rax)
  12:	10 00                	adc    %al,(%rax)
  14:	0f 87 94 00 00 00    	ja     0xae
  1a:	4d 85 ed             	test   %r13,%r13
  1d:	75 79                	jne    0x98
  1f:	9c                   	pushf
  20:	58                   	pop    %rax
  21:	f6 c4 02             	test   $0x2,%ah
  24:	0f 85 6d 01 00 00    	jne    0x197
* 2a:	5b                   	pop    %rbx <-- trapping instruction
  2b:	b8 01 00 00 00       	mov    $0x1,%eax
  30:	5d                   	pop    %rbp
  31:	41 5c                	pop    %r12
  33:	41 5d                	pop    %r13
  35:	41 5e                	pop    %r14
  37:	e9 47 b4 5d 09       	jmp    0x95db483
  3c:	e8                   	.byte 0xe8
  3d:	82                   	(bad)
  3e:	db                   	.byte 0xdb
  3f:	a1                   	.byte 0xa1

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/18 06:30 upstream 4663747812d1 74c9d252 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto WARNING: refcount bug in delayed_put_task_struct
2025/06/17 23:57 upstream 4663747812d1 74c9d252 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto WARNING: refcount bug in delayed_put_task_struct
2025/06/17 23:45 upstream 4663747812d1 74c9d252 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto WARNING: refcount bug in delayed_put_task_struct
* Struck through repros no longer work on HEAD.