syzbot


WARNING: refcount bug in register_netdevice

Status: fixed on 2021/11/10 00:50
Subsystems: net
[Documentation on labels]
Fix commit: 7f700334be9a ip6_gre: proper dev_{hold|put} in ndo_[un]init methods
First crash: 1140d, last: 1133d
Cause bisection: introduced by (bisect log) [merge commit]:
commit 7fafb54c7d390e9b273a1d7d377e38d9c408046e
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Wed Oct 14 22:22:07 2020 +0000

  Merge tag 'leds-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds

Crash: kernel panic: panic_on_warn set (log)
Repro: C syz .config
  

Sample crash report:
netlink: 48 bytes leftover after parsing attributes in process `syz-executor556'.
------------[ cut here ]------------
refcount_t: decrement hit 0; leaking memory.
WARNING: CPU: 0 PID: 8426 at lib/refcount.c:31 refcount_warn_saturate+0xbf/0x1e0 lib/refcount.c:31
Modules linked in:
CPU: 0 PID: 8426 Comm: syz-executor556 Not tainted 5.12.0-rc4-next-20210326-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:refcount_warn_saturate+0xbf/0x1e0 lib/refcount.c:31
Code: 1d 5b 7f e6 09 31 ff 89 de e8 7d b6 a7 fd 84 db 75 e0 e8 c4 af a7 fd 48 c7 c7 60 3e c2 89 c6 05 3b 7f e6 09 01 e8 04 00 fe 04 <0f> 0b eb c4 e8 a8 af a7 fd 0f b6 1d 2a 7f e6 09 31 ff 89 de e8 48
RSP: 0018:ffffc90000f0ee58 EFLAGS: 00010282
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff8880190cd580 RSI: ffffffff815c3fd5 RDI: fffff520001e1dbd
RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff815bd77e R11: 0000000000000000 R12: dffffc0000000000
R13: ffffc90000f0efa0 R14: ffff888019af0568 R15: ffff8880126b2e00
FS:  0000000000cd1300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055bce64723b8 CR3: 0000000027595000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __refcount_dec include/linux/refcount.h:344 [inline]
 refcount_dec include/linux/refcount.h:359 [inline]
 dev_put include/linux/netdevice.h:4135 [inline]
 unregister_netdevice_many+0x1225/0x1790 net/core/dev.c:11037
 unregister_netdevice_queue+0x2dd/0x3c0 net/core/dev.c:10934
 register_netdevice+0x10d6/0x1500 net/core/dev.c:10292
 ip6gre_newlink_common.constprop.0+0x158/0x410 net/ipv6/ip6_gre.c:1984
 ip6erspan_newlink+0x280/0x790 net/ipv6/ip6_gre.c:2251
 __rtnl_newlink+0x1062/0x1710 net/core/rtnetlink.c:3443
 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3491
 rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5553
 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2502
 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline]
 netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1338
 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1927
 sock_sendmsg_nosec net/socket.c:654 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:674
 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2350
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2404
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2433
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x43f429
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:00007ffd5dda0cf8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000400488 RCX: 000000000043f429
RDX: 0000000020001000 RSI: 0000000020000080 RDI: 0000000000000004
RBP: 0000000000000014 R08: 0000000000000015 R09: 65732f636f72702f
R10: 0000000000000008 R11: 0000000000000246 R12: 00000000004033b0
R13: 0000000000000000 R14: 00000000004ad018 R15: 0000000000400488

Crashes (97):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/03/27 15:53 linux-next 931294922e65 a8529b82 .config console log report syz C ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/04/02 23:54 bpf-next 89d69c5d0fbc 6a81331a .config console log report info ci-upstream-bpf-next-kasan-gce WARNING: refcount bug in register_netdevice
2021/04/02 03:36 bpf-next 89d69c5d0fbc 6a81331a .config console log report info ci-upstream-bpf-next-kasan-gce WARNING: refcount bug in register_netdevice
2021/04/01 19:51 bpf-next 89d69c5d0fbc 6a81331a .config console log report info ci-upstream-bpf-next-kasan-gce WARNING: refcount bug in register_netdevice
2021/04/01 15:40 bpf-next e27bfefb21f2 6a81331a .config console log report info ci-upstream-bpf-next-kasan-gce WARNING: refcount bug in register_netdevice
2021/04/01 04:33 bpf-next 235fc0e36d35 6a81331a .config console log report info ci-upstream-bpf-next-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/31 20:28 net-next-old 37f368d8d09d 6a81331a .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/31 17:00 net-next-old 37f368d8d09d 6a81331a .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/31 15:53 net-next-old 37f368d8d09d 6a81331a .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/31 10:46 net-next-old 37f368d8d09d 6a81331a .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/31 08:58 net-next-old 37f368d8d09d 6a81331a .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/30 23:16 bpf-next 2976706f3408 6a81331a .config console log report info ci-upstream-bpf-next-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/30 20:12 net-next-old 37f368d8d09d 6a81331a .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/30 17:16 net-next-old 37f368d8d09d 6a81331a .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/30 14:09 net-next-old 37f368d8d09d 6a81331a .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/30 09:47 net-next-old 37f368d8d09d 6a81331a .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/30 05:39 net-next-old 37f368d8d09d 6a81331a .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/30 02:54 net-next-old 37f368d8d09d 6a81331a .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/30 01:42 bpf-next 36e798516078 6a81331a .config console log report info ci-upstream-bpf-next-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/29 21:53 net-next-old 37f368d8d09d 6a81331a .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/29 19:54 bpf-next 36e798516078 6a81331a .config console log report info ci-upstream-bpf-next-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/29 15:26 net-next-old 72642f4127c3 a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/29 12:22 net-next-old 72642f4127c3 a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/29 10:19 net-next-old 72642f4127c3 a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/29 08:32 net-next-old 72642f4127c3 a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/29 07:27 net-next-old 72642f4127c3 a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/29 06:37 net-next-old 72642f4127c3 a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/29 06:29 bpf-next 36e798516078 a8529b82 .config console log report info ci-upstream-bpf-next-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/29 04:46 net-next-old a1281601f88e a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/29 04:21 bpf-next 36e798516078 a8529b82 .config console log report info ci-upstream-bpf-next-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/28 20:07 net-next-old a1281601f88e a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/28 20:06 net-next-old a1281601f88e a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/28 17:26 net-next-old a1281601f88e a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/28 17:05 net-next-old a1281601f88e a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/28 16:51 net-next-old a1281601f88e a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/28 16:44 net-next-old a1281601f88e a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/03/28 15:48 net-next-old a1281601f88e a8529b82 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in register_netdevice
2021/04/01 12:01 linux-next 931294922e65 6a81331a .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/03/31 18:53 linux-next 931294922e65 6a81331a .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/03/31 14:35 linux-next 931294922e65 6a81331a .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/03/31 11:08 linux-next 931294922e65 6a81331a .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/03/31 04:05 linux-next 931294922e65 6a81331a .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/03/30 12:28 linux-next 931294922e65 6a81331a .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/03/30 06:18 linux-next 931294922e65 6a81331a .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/03/29 18:33 linux-next 931294922e65 a8529b82 .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/03/29 17:22 linux-next 931294922e65 a8529b82 .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/03/29 11:16 linux-next 931294922e65 a8529b82 .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/03/29 05:53 linux-next 931294922e65 a8529b82 .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/03/28 16:21 linux-next 931294922e65 a8529b82 .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
2021/03/27 08:49 linux-next 931294922e65 a8529b82 .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: refcount bug in register_netdevice
* Struck through repros no longer work on HEAD.