syzbot


WARNING: refcount bug in sk_psock_get (2)

Status: upstream: reported C repro on 2022/06/03 15:34
Reported-by: syzbot+5f26f85569bd179c18ce@syzkaller.appspotmail.com
First crash: 22d, last: 20d

Cause bisection: introduced by (bisect log) :
commit 341adeec9adad0874f29a0a1af35638207352a39
Author: Wen Gu <guwen@linux.alibaba.com>
Date: Wed Jan 26 15:33:04 2022 +0000

  net/smc: Forward wakeup to smc socket waitqueue after fallback

Crash: WARNING: refcount bug in sk_psock_get (log)
Repro: C syz .config
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: refcount bug in sk_psock_get C done 8 414d 441d 22/22 fixed on 2021/11/10 00:50

Sample crash report:
------------[ cut here ]------------
refcount_t: saturated; leaking memory.
WARNING: CPU: 1 PID: 3604 at lib/refcount.c:19 refcount_warn_saturate+0xf4/0x1e0 lib/refcount.c:19
Modules linked in:
CPU: 1 PID: 3604 Comm: syz-executor122 Not tainted 5.18.0-syzkaller-11972-gd1dc87763f40 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:refcount_warn_saturate+0xf4/0x1e0 lib/refcount.c:19
Code: 1d 84 03 aa 09 31 ff 89 de e8 b8 9a 7d fd 84 db 75 ab e8 af 9e 7d fd 48 c7 c7 00 15 28 8a c6 05 64 03 aa 09 01 e8 6e 9a 34 05 <0f> 0b eb 8f e8 93 9e 7d fd 0f b6 1d 4e 03 aa 09 31 ff 89 de e8 83
RSP: 0018:ffffc90002fdf9d0 EFLAGS: 00010282
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff888025d90000 RSI: ffffffff8160ed68 RDI: fffff520005fbf2c
RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000000 R11: 0000000000000001 R12: 1ffff920005fbf3d
R13: 000000009097a301 R14: ffff88807eb10000 R15: ffffc90002fdfa08
FS:  0000555556d4f300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fac62bc2300 CR3: 000000007170a000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __refcount_add_not_zero include/linux/refcount.h:163 [inline]
 __refcount_inc_not_zero include/linux/refcount.h:227 [inline]
 refcount_inc_not_zero include/linux/refcount.h:245 [inline]
 sk_psock_get+0x3bc/0x410 include/linux/skmsg.h:439
 tls_data_ready+0x6d/0x1b0 net/tls/tls_sw.c:2091
 tcp_data_ready+0x106/0x520 net/ipv4/tcp_input.c:4983
 tcp_data_queue+0x25f2/0x4c90 net/ipv4/tcp_input.c:5057
 tcp_rcv_state_process+0x1774/0x4e80 net/ipv4/tcp_input.c:6659
 tcp_v4_do_rcv+0x339/0x980 net/ipv4/tcp_ipv4.c:1682
 sk_backlog_rcv include/net/sock.h:1061 [inline]
 __release_sock+0x134/0x3b0 net/core/sock.c:2849
 release_sock+0x54/0x1b0 net/core/sock.c:3404
 inet_shutdown+0x1e0/0x430 net/ipv4/af_inet.c:909
 __sys_shutdown_sock net/socket.c:2331 [inline]
 __sys_shutdown_sock net/socket.c:2325 [inline]
 __sys_shutdown+0xf1/0x1b0 net/socket.c:2343
 __do_sys_shutdown net/socket.c:2351 [inline]
 __se_sys_shutdown net/socket.c:2349 [inline]
 __x64_sys_shutdown+0x50/0x70 net/socket.c:2349
 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+0x46/0xb0
RIP: 0033:0x7f307f3a9959
Code: 28 c3 e8 4a 15 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:00007ffcb2adc7b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000030
RAX: ffffffffffffffda RBX: 00007ffcb2adc7c8 RCX: 00007f307f3a9959
RDX: 00007f307f3a9959 RSI: 0000000000000001 RDI: 0000000000000003
RBP: 0000000000000003 R08: bb1414ac00000000 R09: bb1414ac00000000
R10: 0000000000000028 R11: 0000000000000246 R12: 00007ffcb2adc7d0
R13: 00007ffcb2adc7c4 R14: 0000000000000003 R15: 0000000000000000
 </TASK>

Crashes (3):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce 2022/06/02 19:57 upstream d1dc87763f40 5783034f .config log report syz C WARNING: refcount bug in sk_psock_get
ci-upstream-net-kasan-gce 2022/06/02 14:25 net-next 7e062cda7d90 5783034f .config log report syz C WARNING: refcount bug in sk_psock_get
ci-upstream-net-this-kasan-gce 2022/06/04 22:36 net 58f9d52ff689 c8857892 .config log report info WARNING: refcount bug in sk_psock_get