syzbot


WARNING: refcount bug in nsim_fib_event_nb

Status: upstream: reported on 2024/09/26 09:06
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+ed81dabfbde89a6311b5@syzkaller.appspotmail.com
First crash: 132d, last: 4d11h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [net?] WARNING: refcount bug in nsim_fib_event_nb 0 (1) 2024/09/26 09:06

Sample crash report:
netdevsim netdevsim1 netdevsim0 (unregistering): unset [1, 0] type 2 family 0 port 6081 - 0
------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 1 PID: 10668 at lib/refcount.c:25 refcount_warn_saturate+0x13a/0x1d0 lib/refcount.c:25
Modules linked in:
CPU: 1 UID: 0 PID: 10668 Comm: kworker/u8:26 Not tainted 6.12.0-rc1-syzkaller-00196-ga354733c738d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: netns cleanup_net
RIP: 0010:refcount_warn_saturate+0x13a/0x1d0 lib/refcount.c:25
Code: 00 b3 60 8c e8 f7 ef 99 fc 90 0f 0b 90 90 eb b9 e8 8b f3 d8 fc c6 05 79 ca 4a 0b 01 90 48 c7 c7 60 b3 60 8c e8 d7 ef 99 fc 90 <0f> 0b 90 90 eb 99 e8 6b f3 d8 fc c6 05 5a ca 4a 0b 01 90 48 c7 c7
RSP: 0018:ffffc9000a0d73a0 EFLAGS: 00010246
RAX: 63aeaa80971e2b00 RBX: ffff888032b9383c RCX: ffff888081803c00
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000002 R08: ffffffff8155daa2 R09: 1ffffffff2858b30
R10: dffffc0000000000 R11: fffffbfff2858b31 R12: ffffffffffffffff
R13: ffff88807bc57000 R14: ffff888032b9383c R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f47740ddf98 CR3: 0000000031872000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __refcount_inc include/linux/refcount.h:241 [inline]
 refcount_inc include/linux/refcount.h:258 [inline]
 fib_info_hold include/net/ip_fib.h:613 [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+0xee9/0x10b0 drivers/net/netdevsim/fib.c:1043
 call_fib_notifier+0x42/0x70 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:2203 [inline]
 fib_table_notify net/ipv4/fib_trie.c:2221 [inline]
 fib_notify+0x445/0x780 net/ipv4/fib_trie.c:2244
 fib_net_dump net/core/fib_notifier.c:71 [inline]
 register_fib_notifier+0x182/0x370 net/core/fib_notifier.c:109
 nsim_fib_create+0x902/0xa70 drivers/net/netdevsim/fib.c:1594
 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1480 [inline]
 nsim_dev_reload_up+0x3d1/0x8e0 drivers/net/netdevsim/dev.c:985
 devlink_reload+0x478/0x870 net/devlink/dev.c:474
 devlink_pernet_pre_exit+0x1f3/0x440 net/devlink/core.c:509
 ops_pre_exit_list net/core/net_namespace.c:163 [inline]
 cleanup_net+0x615/0xcc0 net/core/net_namespace.c:606
 process_one_work kernel/workqueue.c:3229 [inline]
 process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310
 worker_thread+0x870/0xd30 kernel/workqueue.c:3391
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/11 02:24 net a354733c738d 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING: refcount bug in nsim_fib_event_nb
2024/09/07 15:08 net d759ee240d3c 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING: refcount bug in nsim_fib_event_nb
2024/07/16 03:16 bpf-next 69cf87304dcb efee4ed2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING: refcount bug in nsim_fib_event_nb
2024/06/04 20:08 net-next 2b438c5774cc a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in nsim_fib_event_nb
* Struck through repros no longer work on HEAD.