syzbot


WARNING: refcount bug in nsim_fib_event_nb (2)

Status: upstream: reported on 2025/07/23 10:09
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+ea02c8daa5dc1c52b364@syzkaller.appspotmail.com
First crash: 40d, last: 8d18h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [net?] WARNING: refcount bug in nsim_fib_event_nb (2) 0 (1) 2025/07/23 10:09
Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 WARNING: refcount bug in nsim_fib_event_nb 13 1 280d 280d 0/3 auto-obsoleted due to no activity on 2025/02/28 08:27
upstream WARNING: refcount bug in nsim_fib_event_nb net 13 5 295d 335d 0/29 auto-obsoleted due to no activity on 2025/02/13 14:42

Sample crash report:
netdevsim netdevsim9 netdevsim0 (unregistering): unset [1, 0] type 2 family 0 port 6081 - 0
------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 0 PID: 14135 at lib/refcount.c:25 refcount_warn_saturate+0x1ca/0x210 lib/refcount.c:25
Modules linked in:
CPU: 0 UID: 0 PID: 14135 Comm: kworker/u8:5 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Workqueue: netns cleanup_net
RIP: 0010:refcount_warn_saturate+0x1ca/0x210 lib/refcount.c:25
Code: ff 89 de e8 b8 f1 d9 fc 84 db 0f 85 e6 fe ff ff e8 cb f6 d9 fc c6 05 99 3b b2 0b 01 90 48 c7 c7 80 9d 15 8c e8 f7 97 98 fc 90 <0f> 0b 90 90 e9 c3 fe ff ff e8 a8 f6 d9 fc c6 05 74 3b b2 0b 01 90
RSP: 0018:ffffc9001180f4c0 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff817a3358
RDX: ffff888030475a00 RSI: ffffffff817a3365 RDI: 0000000000000001
RBP: ffff888033fa243c R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 746e756f63666572 R12: ffff888033fa243c
R13: 0000000000000002 R14: ffff888076731f80 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8881246bd000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000059030 CR3: 0000000062d59000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 __refcount_add include/linux/refcount.h:289 [inline]
 __refcount_inc include/linux/refcount.h:366 [inline]
 refcount_inc include/linux/refcount.h:383 [inline]
 fib_info_hold include/net/ip_fib.h:629 [inline]
 nsim_fib4_prepare_event drivers/net/netdevsim/fib.c:930 [inline]
 nsim_fib_event_schedule_work drivers/net/netdevsim/fib.c:1000 [inline]
 nsim_fib_event_nb+0xe10/0x10d0 drivers/net/netdevsim/fib.c:1043
 call_fib_notifier+0x3c/0x80 net/core/fib_notifier.c:24
 call_fib_entry_notifier net/ipv4/fib_trie.c:90 [inline]
 fib_leaf_notify net/ipv4/fib_trie.c:2175 [inline]
 fib_table_notify net/ipv4/fib_trie.c:2193 [inline]
 fib_notify+0x371/0x590 net/ipv4/fib_trie.c:2216
 fib4_dump+0x48/0x60 net/ipv4/fib_notifier.c:45
 fib_net_dump net/core/fib_notifier.c:69 [inline]
 register_fib_notifier+0x123/0x470 net/core/fib_notifier.c:107
 nsim_fib_create+0x938/0xc90 drivers/net/netdevsim/fib.c:1596
 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1528 [inline]
 nsim_dev_reload_up+0x3f6/0x860 drivers/net/netdevsim/dev.c:1003
 devlink_reload+0x325/0x7c0 net/devlink/dev.c:474
 devlink_pernet_pre_exit+0x1a0/0x2b0 net/devlink/core.c:509
 ops_pre_exit_list net/core/net_namespace.c:160 [inline]
 ops_undo_list+0x187/0xab0 net/core/net_namespace.c:233
 cleanup_net+0x408/0x890 net/core/net_namespace.c:682
 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3236
 process_scheduled_works kernel/workqueue.c:3319 [inline]
 worker_thread+0x6c8/0xf10 kernel/workqueue.c:3400
 kthread+0x3c5/0x780 kernel/kthread.c:463
 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>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/19 11:49 upstream be48bcf004f9 523f460e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root WARNING: refcount bug in nsim_fib_event_nb
2025/07/18 20:50 upstream 6832a9317eee f550e092 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in nsim_fib_event_nb
* Struck through repros no longer work on HEAD.