syzbot


WARNING: refcount bug in smc_pnet_add

Status: fixed on 2023/02/24 13:50
Subsystems: net s390
[Documentation on labels]
Fix commit: 28f922213886 net/smc: fix ref_tracker issue in smc_pnet_add()
First crash: 811d, last: 797d
Cause bisection: introduced by (bisect log) :
commit f2f2325ec79970807012dfc9e716cdbb02d9b574
Author: Eric Dumazet <edumazet@google.com>
Date: Fri Feb 4 20:15:46 2022 +0000

  ip6mr: ip6mr_sk_done() can exit early in common cases

Crash: KASAN: use-after-free Read in ip6mr_sk_done (log)
Repro: C syz .config
  

Sample crash report:
------------[ cut here ]------------
refcount_t: decrement hit 0; leaking memory.
WARNING: CPU: 1 PID: 3610 at lib/refcount.c:31 refcount_warn_saturate+0xbf/0x1e0 lib/refcount.c:31
Modules linked in:
CPU: 1 PID: 3610 Comm: syz-executor148 Not tainted 5.17.0-rc2-syzkaller-00650-g5a8fb33e5305 #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 f4 70 a0 09 31 ff 89 de e8 4d bc 99 fd 84 db 75 e0 e8 64 b8 99 fd 48 c7 c7 20 0c 06 8a c6 05 d4 70 a0 09 01 e8 9e 4e 28 05 <0f> 0b eb c4 e8 48 b8 99 fd 0f b6 1d c3 70 a0 09 31 ff 89 de e8 18
RSP: 0018:ffffc9000286f400 EFLAGS: 00010282
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff88801af89d00 RSI: ffffffff815fb318 RDI: fffff5200050de72
RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff815f507e R11: 0000000000000000 R12: 1ffff9200050de85
R13: 0000000000000000 R14: ffff88807e12c600 R15: 0000000000000000
FS:  000055555698c300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffcc81ccbc8 CR3: 0000000017a6e000 CR4: 00000000003506f0
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+0x53f/0x6c0 lib/ref_tracker.c:119
 netdev_tracker_free include/linux/netdevice.h:3867 [inline]
 dev_put_track include/linux/netdevice.h:3884 [inline]
 dev_put_track include/linux/netdevice.h:3880 [inline]
 dev_put include/linux/netdevice.h:3910 [inline]
 smc_pnet_add_eth net/smc/smc_pnet.c:399 [inline]
 smc_pnet_enter net/smc/smc_pnet.c:493 [inline]
 smc_pnet_add+0x5fc/0x15f0 net/smc/smc_pnet.c:556
 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:731
 genl_family_rcv_msg net/netlink/genetlink.c:775 [inline]
 genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:792
 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803
 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline]
 netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343
 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919
 sock_sendmsg_nosec net/socket.c:705 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:725
 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2413
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7ff0e6906b79
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 15 00 00 90 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:00007ffcc81cdc38 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007ff0e6906b79
RDX: 0000000000000000 RSI: 0000000020000380 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000000 R09: 000000000000000d
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffcc81cdc50
R13: 00000000000f4240 R14: 000000000000bdd4 R15: 00007ffcc81cdc44
 </TASK>

Crashes (98):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/02/06 21:31 net-next-old 5a8fb33e5305 a7dab638 .config console log report syz C ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/06 07:14 net-next-old 5a8fb33e5305 a7dab638 .config console log report syz C ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/19 15:35 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/19 09:35 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/19 07:59 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/19 04:59 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/19 00:44 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/18 21:14 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/18 19:39 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/18 17:39 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/18 14:48 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/18 11:38 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/18 09:32 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/18 07:31 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/18 00:34 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/17 22:42 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/17 20:44 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/17 15:57 net-next-old 5a8fb33e5305 3cd800e4 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/17 12:03 net-next-old 5a8fb33e5305 2bea8a27 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/17 09:30 net-next-old 5a8fb33e5305 2bea8a27 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/17 05:51 net-next-old 5a8fb33e5305 2bea8a27 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/17 01:06 net-next-old 5a8fb33e5305 2bea8a27 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/16 20:40 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/16 19:15 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/16 07:41 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/16 00:01 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/15 19:28 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/15 14:45 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/15 13:17 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/15 10:49 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/15 07:37 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/15 02:41 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/14 23:46 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/14 23:12 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/14 09:12 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/14 04:30 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/14 01:13 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/14 00:10 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/13 22:20 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/13 15:12 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/13 10:53 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/13 09:08 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/13 06:17 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/13 00:11 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/12 20:52 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/12 17:44 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/12 13:20 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/12 06:10 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/12 01:55 net-next-old 5a8fb33e5305 8b9ca619 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
2022/02/05 23:06 net-next-old 5a8fb33e5305 a7dab638 .config console log report info ci-upstream-net-kasan-gce WARNING: refcount bug in smc_pnet_add
* Struck through repros no longer work on HEAD.