syzbot


WARNING: refcount bug in tipc_crypto_xmit

Status: upstream: reported C repro on 2025/05/26 08:50
Subsystems: tipc
[Documentation on labels]
Reported-by: syzbot+f0c4a4aba757549ae26c@syzkaller.appspotmail.com
Fix commit: net: tipc: fix refcount warning in tipc_aead_encrypt
Patched on: [ci-upstream-linux-next-kasan-gce-root ci-upstream-net-this-kasan-gce], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-net-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 7d15h, last: now
Cause bisection: introduced by (bisect log) :
commit e279024617134c94fd3e37470156534d5f2b3472
Author: Wang Liang <wangliang74@huawei.com>
Date: Tue May 20 10:14:04 2025 +0000

  net/tipc: fix slab-use-after-free Read in tipc_aead_encrypt_done

Crash: WARNING: refcount bug in tipc_crypto_xmit (log)
Repro: C syz .config
  
Discussions (3)
Title Replies (including bot) Last reply
[PATCH net v2] net: tipc: fix refcount warning in tipc_aead_encrypt 3 (3) 2025/05/29 10:10
[PATCH net] net: tipc: fix refcount warning in tipc_aead_encrypt 3 (3) 2025/05/27 16:39
[syzbot] [tipc?] WARNING: refcount bug in tipc_crypto_xmit 1 (3) 2025/05/26 18:41
Last patch testing requests (1)
Created Duration User Patch Repo Result
2025/05/26 12:27 56m charmitro@posteo.net https://github.com/charmitro/linux.git d72ee421a78726747979874e8dba97c1641df213 OK log

Sample crash report:
------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 1 PID: 36 at lib/refcount.c:25 refcount_warn_saturate+0xfa/0x1d0 lib/refcount.c:25
Modules linked in:
CPU: 1 UID: 0 PID: 36 Comm: kworker/u8:2 Not tainted 6.15.0-rc7-syzkaller-00144-gb1427432d3b6 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: netns cleanup_net
RIP: 0010:refcount_warn_saturate+0xfa/0x1d0 lib/refcount.c:25
Code: 00 00 e8 79 f6 06 fd 5b 41 5e e9 81 6c a0 06 cc e8 6b f6 06 fd c6 05 06 3c b0 0a 01 90 48 c7 c7 80 aa c1 8b e8 e7 52 cb fc 90 <0f> 0b 90 90 eb d7 e8 4b f6 06 fd c6 05 e7 3b b0 0a 01 90 48 c7 c7
RSP: 0018:ffffc90000a08668 EFLAGS: 00010246
RAX: bb5b0788a28fc300 RBX: 0000000000000002 RCX: ffff888142681e00
RDX: 0000000000000100 RSI: 0000000000000000 RDI: 0000000000000002
RBP: ffffc90000a087e8 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffffbfff1bba984 R12: ffff88807df80000
R13: dffffc0000000000 R14: ffff88807df8016c R15: ffff888033397800
FS:  0000000000000000(0000) GS:ffff8881261c2000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555569a1e878 CR3: 000000007b8fc000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 __refcount_add include/linux/refcount.h:-1 [inline]
 __refcount_inc include/linux/refcount.h:366 [inline]
 refcount_inc include/linux/refcount.h:383 [inline]
 get_net include/net/net_namespace.h:268 [inline]
 tipc_aead_encrypt net/tipc/crypto.c:821 [inline]
 tipc_crypto_xmit+0x1820/0x22c0 net/tipc/crypto.c:1761
 tipc_crypto_clone_msg+0x90/0x170 net/tipc/crypto.c:1656
 tipc_crypto_xmit+0x1998/0x22c0 net/tipc/crypto.c:1717
 tipc_bearer_xmit_skb+0x245/0x400 net/tipc/bearer.c:572
 tipc_disc_timeout+0x580/0x6d0 net/tipc/discover.c:338
 call_timer_fn+0x17b/0x5f0 kernel/time/timer.c:1789
 expire_timers kernel/time/timer.c:1840 [inline]
 __run_timers kernel/time/timer.c:2414 [inline]
 __run_timer_base+0x61a/0x860 kernel/time/timer.c:2426
 run_timer_base kernel/time/timer.c:2435 [inline]
 run_timer_softirq+0xb7/0x180 kernel/time/timer.c:2445
 handle_softirqs+0x286/0x870 kernel/softirq.c:579
 __do_softirq kernel/softirq.c:613 [inline]
 invoke_softirq kernel/softirq.c:453 [inline]
 __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
 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:lock_acquire+0x175/0x360 kernel/locking/lockdep.c:5870
Code: 00 00 00 00 9c 8f 44 24 30 f7 44 24 30 00 02 00 00 0f 85 cd 00 00 00 f7 44 24 08 00 02 00 00 74 01 fb 65 48 8b 05 8b 9f d7 10 <48> 3b 44 24 58 0f 85 f2 00 00 00 48 83 c4 60 5b 41 5c 41 5d 41 5e
RSP: 0018:ffffc90000ad7378 EFLAGS: 00000206
RAX: bb5b0788a28fc300 RBX: 0000000000000000 RCX: bb5b0788a28fc300
RDX: 0000000000000000 RSI: ffffffff8d939072 RDI: ffffffff8bc1f600
RBP: ffffffff8171ca05 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: ffffffff8171ca05 R12: 0000000000000002
R13: ffffffff8df3dee0 R14: 0000000000000000 R15: 0000000000000246
 rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
 rcu_read_lock include/linux/rcupdate.h:841 [inline]
 class_rcu_constructor include/linux/rcupdate.h:1155 [inline]
 unwind_next_frame+0xc2/0x2390 arch/x86/kernel/unwind_orc.c:479
 arch_stack_walk+0x11c/0x150 arch/x86/kernel/stacktrace.c:25
 stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:122
 kasan_save_stack+0x3e/0x60 mm/kasan/common.c:47
 kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:548
 __call_rcu_common kernel/rcu/tree.c:3082 [inline]
 call_rcu+0x142/0x990 kernel/rcu/tree.c:3202
 inet_release+0x187/0x210 net/ipv4/af_inet.c:435
 __sock_release net/socket.c:647 [inline]
 sock_release+0x85/0x150 net/socket.c:675
 wg_netns_pre_exit+0xd6/0x1d0 drivers/net/wireguard/device.c:423
 ops_pre_exit_list net/core/net_namespace.c:162 [inline]
 cleanup_net+0x594/0xbd0 net/core/net_namespace.c:634
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319
 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
 kthread+0x70e/0x8a0 kernel/kthread.c:464
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153
 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:	9c                   	pushf
   5:	8f 44 24 30          	pop    0x30(%rsp)
   9:	f7 44 24 30 00 02 00 	testl  $0x200,0x30(%rsp)
  10:	00
  11:	0f 85 cd 00 00 00    	jne    0xe4
  17:	f7 44 24 08 00 02 00 	testl  $0x200,0x8(%rsp)
  1e:	00
  1f:	74 01                	je     0x22
  21:	fb                   	sti
  22:	65 48 8b 05 8b 9f d7 	mov    %gs:0x10d79f8b(%rip),%rax        # 0x10d79fb5
  29:	10
* 2a:	48 3b 44 24 58       	cmp    0x58(%rsp),%rax <-- trapping instruction
  2f:	0f 85 f2 00 00 00    	jne    0x127
  35:	48 83 c4 60          	add    $0x60,%rsp
  39:	5b                   	pop    %rbx
  3a:	41 5c                	pop    %r12
  3c:	41 5d                	pop    %r13
  3e:	41 5e                	pop    %r14

Crashes (2845):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/25 06:00 upstream b1427432d3b6 ed351ea7 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/30 07:46 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/30 06:41 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: refcount bug in tipc_crypto_xmit
2025/05/30 06:41 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/30 05:34 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/30 04:59 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/30 03:29 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/30 02:28 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in tipc_crypto_xmit
2025/05/30 01:31 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/30 00:50 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 23:15 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 22:57 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 21:08 upstream e0797d3b91de 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 20:06 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 19:51 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 18:49 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 16:41 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 12:21 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 10:05 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 09:02 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 08:56 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 07:46 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 06:45 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 06:08 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 05:05 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 04:47 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 03:46 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 02:10 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 01:51 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 00:31 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/28 23:10 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root WARNING: refcount bug in tipc_crypto_xmit
2025/05/28 21:04 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/28 19:51 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: refcount bug in tipc_crypto_xmit
2025/05/28 19:01 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/28 18:54 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root WARNING: refcount bug in tipc_crypto_xmit
2025/05/30 09:13 upstream f66bc387efbe 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 23:44 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 21:55 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 17:49 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 16:31 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 15:28 upstream 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 03:12 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: refcount bug in tipc_crypto_xmit
2025/05/28 22:11 upstream feacb1774bd5 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: refcount bug in tipc_crypto_xmit
2025/05/28 04:54 upstream c89756bcf406 874a1386 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 14:09 upstream 90b83efa6701 3d2f584d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 15:22 net 271683bb2cf3 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/30 09:10 net-next 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/30 03:52 net-next 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 13:52 net-next 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 11:09 net-next 90b83efa6701 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/29 00:42 net-next f6bd8faeb113 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/28 22:05 net-next f6bd8faeb113 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in tipc_crypto_xmit
2025/05/28 20:36 linux-next 64d12554715c 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in tipc_crypto_xmit
* Struck through repros no longer work on HEAD.