syzbot


WARNING: refcount bug in fib6_nh_init

Status: fixed on 2023/09/28 17:51
Subsystems: net
[Documentation on labels]
Fix commit: 3515440df461 ipv6: also use netdev_hold() in ip6_route_check_nh()
First crash: 339d, last: 333d
Cause bisection: introduced by (bisect log) :
commit 70f7457ad6d655e65f1b93cbba2a519e4b11c946
Author: Jakub Kicinski <kuba@kernel.org>
Date: Mon Jun 12 21:49:43 2023 +0000

  net: create device lookup API with reference tracking

Crash: WARNING: refcount bug in fib6_nh_init (log)
Repro: C syz .config
  

Sample crash report:
------------[ cut here ]------------
refcount_t: decrement hit 0; leaking memory.
WARNING: CPU: 1 PID: 5004 at lib/refcount.c:31 refcount_warn_saturate+0x1d7/0x1f0 lib/refcount.c:31
Modules linked in:
CPU: 1 PID: 5004 Comm: syz-executor282 Not tainted 6.4.0-rc5-syzkaller-01229-g97c5209b3d37 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
RIP: 0010:refcount_warn_saturate+0x1d7/0x1f0 lib/refcount.c:31
Code: 05 fb 8e 51 0a 01 e8 98 95 38 fd 0f 0b e9 d3 fe ff ff e8 ac d9 70 fd 48 c7 c7 00 d3 a6 8a c6 05 d8 8e 51 0a 01 e8 79 95 38 fd <0f> 0b e9 b4 fe ff ff 48 89 ef e8 1a d7 c3 fd e9 5c fe ff ff 0f 1f
RSP: 0018:ffffc9000398eef8 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff8880288abb80 RSI: ffffffff814c03b7 RDI: 0000000000000001
RBP: ffff888015ed05fc R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: 1ffff92000731de4
R13: 00000000ffffffef R14: ffff888015ed05fc R15: ffff88814a6fe5a8
FS:  0000555555bdc300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f45a59f1b10 CR3: 0000000075cd1000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __refcount_dec include/linux/refcount.h:344 [inline]
 refcount_dec include/linux/refcount.h:359 [inline]
 ref_tracker_free+0x539/0x820 lib/ref_tracker.c:236
 netdev_tracker_free include/linux/netdevice.h:4097 [inline]
 netdev_put include/linux/netdevice.h:4114 [inline]
 netdev_put include/linux/netdevice.h:4110 [inline]
 fib6_nh_init+0xb96/0x1bd0 net/ipv6/route.c:3624
 ip6_route_info_create+0x10f3/0x1980 net/ipv6/route.c:3791
 ip6_route_add+0x28/0x150 net/ipv6/route.c:3835
 inet6_rtm_newroute+0x156/0x160 net/ipv6/route.c:5504
 rtnetlink_rcv_msg+0x43d/0xd50 net/core/rtnetlink.c:6424
 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2548
 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline]
 netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365
 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1913
 sock_sendmsg_nosec net/socket.c:724 [inline]
 sock_sendmsg+0xde/0x190 net/socket.c:747
 splice_to_socket+0x954/0xe30 fs/splice.c:917
 do_splice_from fs/splice.c:969 [inline]
 direct_splice_actor+0x114/0x180 fs/splice.c:1157
 splice_direct_to_actor+0x34a/0x9c0 fs/splice.c:1103
 do_splice_direct+0x1ad/0x280 fs/splice.c:1209
 do_sendfile+0xb19/0x12c0 fs/read_write.c:1254
 __do_sys_sendfile64 fs/read_write.c:1322 [inline]
 __se_sys_sendfile64 fs/read_write.c:1308 [inline]
 __x64_sys_sendfile64+0x1d0/0x210 fs/read_write.c:1308
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fd08cfa6c99
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe42e35998 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fd08cfa6c99
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005
RBP: 00007fd08cf6ae40 R08: 0000000000000000 R09: 0000000000000000
R10: 00000800000017fc R11: 0000000000000246 R12: 00007fd08cf6aed0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Crashes (45):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/15 18:27 net-next 97c5209b3d37 757d26ed .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/15 18:03 net-next 97c5209b3d37 757d26ed .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/15 14:15 net-next 97c5209b3d37 757d26ed .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/15 14:04 net-next 97c5209b3d37 757d26ed .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/18 22:22 net-next b650d953cd39 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/18 15:52 net-next b650d953cd39 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/18 15:52 net-next b650d953cd39 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/18 07:08 net-next a52305a81d6b f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/17 20:04 net-next a52305a81d6b f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/17 14:44 net-next a52305a81d6b f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/16 22:23 net-next c08afcdcf952 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/16 15:22 net-next 97c5209b3d37 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/16 15:12 net-next 97c5209b3d37 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/16 14:41 net-next 97c5209b3d37 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/16 13:26 net-next 97c5209b3d37 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/16 06:15 net-next 97c5209b3d37 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/16 06:04 net-next 97c5209b3d37 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/16 03:28 net-next 97c5209b3d37 757d26ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/16 03:21 net-next 97c5209b3d37 757d26ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/15 22:30 net-next 97c5209b3d37 757d26ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/15 20:30 net-next 97c5209b3d37 757d26ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/15 13:26 net-next 97c5209b3d37 757d26ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/15 13:21 net-next 97c5209b3d37 757d26ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/15 12:46 net-next 97c5209b3d37 757d26ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: refcount bug in fib6_nh_init
2023/06/21 04:50 linux-next f7efed9f38f8 09ffe269 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/20 15:54 linux-next f7efed9f38f8 09ffe269 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/20 12:21 linux-next f7efed9f38f8 09ffe269 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/19 22:08 linux-next f7efed9f38f8 d521bc56 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/19 20:51 linux-next f7efed9f38f8 d521bc56 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/19 16:17 linux-next f7efed9f38f8 d521bc56 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/19 08:53 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/18 22:24 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/18 16:02 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/18 16:02 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/18 15:53 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/18 07:21 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/17 21:56 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/17 05:11 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/16 15:22 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/16 13:25 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/16 09:52 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/16 07:37 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
2023/06/16 07:34 linux-next f7efed9f38f8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in fib6_nh_init
* Struck through repros no longer work on HEAD.