------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 1 PID: 12 at lib/refcount.c:25 refcount_warn_saturate+0xfa/0x1d0 lib/refcount.c:25
Modules linked in:
CPU: 1 UID: 0 PID: 12 Comm: kworker/u8:0 Not tainted 6.15.0-syzkaller-07774-g90b83efa6701 #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 d9 72 00 fd 5b 41 5e e9 01 df a6 06 cc e8 cb 72 00 fd c6 05 67 23 cb 0a 01 90 48 c7 c7 80 19 e2 8b e8 17 5f c4 fc 90 <0f> 0b 90 90 eb d7 e8 ab 72 00 fd c6 05 48 23 cb 0a 01 90 48 c7 c7
RSP: 0018:ffffc90000a08828 EFLAGS: 00010246
RAX: a20b0cb70d77e500 RBX: 0000000000000002 RCX: ffff88801d2dda00
RDX: 0000000000000100 RSI: 0000000000000000 RDI: 0000000000000002
RBP: ffffc90000a089b0 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffffbfff1bfa66c R12: ffff888033f88000
R13: dffffc0000000000 R14: ffff888033f8816c R15: ffff88803220fc00
FS: 0000000000000000(0000) GS:ffff888125d66000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1297963e9c CR3: 0000000056da8000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__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_bearer_xmit_skb+0x245/0x400 net/tipc/bearer.c:572
tipc_disc_timeout+0x580/0x6d0 net/tipc/discover.c:338
call_timer_fn+0x17e/0x5f0 kernel/time/timer.c:1747
expire_timers kernel/time/timer.c:1798 [inline]
__run_timers kernel/time/timer.c:2372 [inline]
__run_timer_base+0x61a/0x860 kernel/time/timer.c:2384
run_timer_base kernel/time/timer.c:2393 [inline]
run_timer_softirq+0xb7/0x180 kernel/time/timer.c:2403
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:1050 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1050
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:arch_atomic_read arch/x86/include/asm/atomic.h:23 [inline]
RIP: 0010:raw_atomic_read include/linux/atomic/atomic-arch-fallback.h:457 [inline]
RIP: 0010:rcu_is_watching_curr_cpu include/linux/context_tracking.h:128 [inline]
RIP: 0010:rcu_is_watching+0x5a/0xb0 kernel/rcu/tree.c:745
Code: f0 48 c1 e8 03 42 80 3c 38 00 74 08 4c 89 f7 e8 ac 45 7c 00 48 c7 c3 58 cf 9c 92 49 03 1e 48 89 d8 48 c1 e8 03 42 0f b6 04 38 <84> c0 75 34 8b 03 65 ff 0d 29 cd f4 10 74 11 83 e0 04 c1 e8 02 5b
RSP: 0018:ffffc90000116ce0 EFLAGS: 00000a06
RAX: 0000000000000000 RBX: ffff8880b8732f58 RCX: a20b0cb70d77e500
RDX: 0000000000000000 RSI: ffffffff8be263e0 RDI: ffffffff8be263a0
RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffff825cc04c
R10: dffffc0000000000 R11: ffffed100365fe1d R12: dffffc0000000000
R13: ffffffff825cc04c R14: ffffffff8db91c68 R15: dffffc0000000000
trace_lock_release include/trace/events/lock.h:69 [inline]
lock_release+0x4b/0x3e0 kernel/locking/lockdep.c:5882
rcu_lock_release include/linux/rcupdate.h:341 [inline]
rcu_read_unlock include/linux/rcupdate.h:871 [inline]
class_rcu_destructor include/linux/rcupdate.h:1155 [inline]
kernfs_root+0x1e5/0x230 fs/kernfs/kernfs-internal.h:78
kernfs_root_is_locked fs/kernfs/kernfs-internal.h:107 [inline]
kernfs_rcu_name fs/kernfs/kernfs-internal.h:112 [inline]
kernfs_sd_compare fs/kernfs/dir.c:349 [inline]
kernfs_link_sibling+0xe6/0x3e0 fs/kernfs/dir.c:380
kernfs_add_one+0x1e0/0x520 fs/kernfs/dir.c:810
__kernfs_create_file+0x22b/0x2e0 fs/kernfs/file.c:1067
sysfs_add_file_mode_ns+0x238/0x300 fs/sysfs/file.c:319
create_files fs/sysfs/group.c:76 [inline]
internal_create_group+0x66d/0x1110 fs/sysfs/group.c:183
internal_create_groups fs/sysfs/group.c:223 [inline]
sysfs_create_groups+0x59/0x120 fs/sysfs/group.c:249
device_add_groups drivers/base/core.c:2839 [inline]
device_add_attrs+0xe0/0x5a0 drivers/base/core.c:2903
device_add+0x496/0xb50 drivers/base/core.c:3646
netdev_register_kobject+0x156/0x2f0 net/core/net-sysfs.c:2336
register_netdevice+0x126c/0x1ae0 net/core/dev.c:11104
nsim_init_netdevsim drivers/net/netdevsim/netdev.c:964 [inline]
nsim_create+0xb19/0xef0 drivers/net/netdevsim/netdev.c:1032
__nsim_dev_port_add+0x70a/0xb20 drivers/net/netdevsim/dev.c:1393
nsim_dev_port_add_all+0x35/0xe0 drivers/net/netdevsim/dev.c:1449
nsim_dev_reload_create drivers/net/netdevsim/dev.c:1501 [inline]
nsim_dev_reload_up+0x451/0x780 drivers/net/netdevsim/dev.c:988
devlink_reload+0x4e9/0x8d0 net/devlink/dev.c:474
devlink_pernet_pre_exit+0x1d9/0x3d0 net/devlink/core.c:509
ops_pre_exit_list net/core/net_namespace.c:162 [inline]
ops_undo_list+0x187/0x990 net/core/net_namespace.c:235
cleanup_net+0x4c5/0x8a0 net/core/net_namespace.c:686
process_one_work kernel/workqueue.c:3238 [inline]
process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3321
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3402
kthread+0x70e/0x8a0 kernel/kthread.c:464
ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
----------------
Code disassembly (best guess):
0: f0 48 c1 e8 03 lock shr $0x3,%rax
5: 42 80 3c 38 00 cmpb $0x0,(%rax,%r15,1)
a: 74 08 je 0x14
c: 4c 89 f7 mov %r14,%rdi
f: e8 ac 45 7c 00 call 0x7c45c0
14: 48 c7 c3 58 cf 9c 92 mov $0xffffffff929ccf58,%rbx
1b: 49 03 1e add (%r14),%rbx
1e: 48 89 d8 mov %rbx,%rax
21: 48 c1 e8 03 shr $0x3,%rax
25: 42 0f b6 04 38 movzbl (%rax,%r15,1),%eax
* 2a: 84 c0 test %al,%al <-- trapping instruction
2c: 75 34 jne 0x62
2e: 8b 03 mov (%rbx),%eax
30: 65 ff 0d 29 cd f4 10 decl %gs:0x10f4cd29(%rip) # 0x10f4cd60
37: 74 11 je 0x4a
39: 83 e0 04 and $0x4,%eax
3c: c1 e8 02 shr $0x2,%eax
3f: 5b pop %rbx