syzbot


WARNING: refcount bug in sk_common_release

Status: fixed on 2024/08/26 12:53
Subsystems: net
[Documentation on labels]
Fix commit: 2fe5273f149c net/smc: prevent UAF in inet_create()
First crash: 143d, last: 128d

Sample crash report:
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>
socket: no more sockets
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 2 PID: 5196 at lib/refcount.c:28 refcount_warn_saturate+0x14a/0x210 lib/refcount.c:28
Modules linked in:
CPU: 2 PID: 5196 Comm: syz-executor390 Not tainted 6.10.0-syzkaller-04472-g51835949dda3 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:refcount_warn_saturate+0x14a/0x210 lib/refcount.c:28
Code: ff 89 de e8 08 81 0a fd 84 db 0f 85 66 ff ff ff e8 5b 86 0a fd c6 05 7b 34 4b 0b 01 90 48 c7 c7 20 ec 8f 8b e8 67 cc cc fc 90 <0f> 0b 90 90 e9 43 ff ff ff e8 38 86 0a fd 0f b6 1d 56 34 4b 0b 31
RSP: 0018:ffffc900032c7d58 EFLAGS: 00010282
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff81504569
RDX: ffff88802b84c880 RSI: ffffffff81504576 RDI: 0000000000000001
RBP: ffff88802b628080 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 00000000ffffffff
R13: ffff88802b628080 R14: ffff88802b628013 R15: ffff88802b62800e
FS:  0000555575eed380(0000) GS:ffff88806b200000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f6e429dc227 CR3: 000000001d3d6000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __refcount_sub_and_test include/linux/refcount.h:275 [inline]
 __refcount_dec_and_test include/linux/refcount.h:307 [inline]
 refcount_dec_and_test include/linux/refcount.h:325 [inline]
 sk_free net/core/sock.c:2260 [inline]
 sock_put include/net/sock.h:1884 [inline]
 sk_common_release+0x2ec/0x420 net/core/sock.c:3773
 inet6_create net/ipv6/af_inet6.c:271 [inline]
 inet6_create+0xef5/0x12e0 net/ipv6/af_inet6.c:120
 __sock_create+0x32e/0x800 net/socket.c:1571
 sock_create net/socket.c:1622 [inline]
 __sys_socket_create net/socket.c:1659 [inline]
 __sys_socket+0x14f/0x260 net/socket.c:1706
 __do_sys_socket net/socket.c:1720 [inline]
 __se_sys_socket net/socket.c:1718 [inline]
 __x64_sys_socket+0x72/0xb0 net/socket.c:1718
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f6e42986669
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 a1 1a 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc3bf364e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000029
RAX: ffffffffffffffda RBX: 00007ffc3bf36500 RCX: 00007f6e42986669
RDX: 0000000000000100 RSI: 0000000000000001 RDI: 000000000000000a
RBP: 0000000000000001 R08: 00007ffc3bf36287 R09: 00000000000000a0
R10: 0000000000000001 R11: 0000000000000246 R12: 00007ffc3bf364fc
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/17 12:40 upstream 51835949dda3 215bec2d .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in sk_common_release
2024/07/31 19:28 upstream e4fc196f5ba3 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: refcount bug in sk_common_release
2024/08/01 20:17 upstream 21b136cc63d2 1e9c4cf3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in sk_common_release
2024/07/27 09:44 upstream 2f8c4f506285 46eb10b7 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in sk_common_release
2024/07/18 21:02 upstream f2f6a8e88717 f3eecf69 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in sk_common_release
2024/07/17 12:26 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: refcount bug in sk_common_release
2024/07/31 21:52 upstream e4fc196f5ba3 1e9c4cf3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: refcount bug in sk_common_release
2024/07/19 02:06 upstream f2f6a8e88717 f3eecf69 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: refcount bug in sk_common_release
2024/07/17 11:02 upstream 51835949dda3 215bec2d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: refcount bug in sk_common_release
* Struck through repros no longer work on HEAD.