syzbot


WARNING in __sock_create

Status: internal: reported C repro on 2024/11/06 13:37
Subsystems: net
[Documentation on labels]
Fix commit: d293958a8595 net/smc: do not leave a dangling sk pointer in __smc_create()
Patched on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 29d, last: 29d
Cause bisection: introduced by (bisect log) :
commit 18429e6e0c2ad26250862a786964d8c73400d9a0
Author: Ignat Korchagin <ignat@cloudflare.com>
Date: Mon Oct 14 15:38:08 2024 +0000

  Revert "net: do not leave a dangling sk pointer, when socket creation fails"

Crash: WARNING in __sock_create (log)
Repro: C syz .config
  
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/11/06 14:29 39m edumazet@google.com patch linux-next OK log

Sample crash report:
R10: 0000000000000001 R11: 0000000000000246 R12: 00007ffffe836c6c
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>
socket: no more sockets
------------[ cut here ]------------
smc_create must clear sock->sk on failure, family: 43, type: 1, protocol: 0
WARNING: CPU: 0 PID: 5831 at net/socket.c:1565 __sock_create+0x96f/0xa30 net/socket.c:1563
Modules linked in:
CPU: 0 UID: 0 PID: 5831 Comm: syz-executor241 Not tainted 6.12.0-rc6-next-20241106-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:__sock_create+0x96f/0xa30 net/socket.c:1563
Code: 03 00 74 08 4c 89 e7 e8 4f 3b 85 f8 49 8b 34 24 48 c7 c7 40 89 0c 8d 8b 54 24 04 8b 4c 24 0c 44 8b 44 24 08 e8 32 78 db f7 90 <0f> 0b 90 90 e9 d3 fd ff ff 89 e9 80 e1 07 fe c1 38 c1 0f 8c ee f7
RSP: 0018:ffffc90003f87da0 EFLAGS: 00010246
RAX: 24ccd31836799200 RBX: 1ffffffff1a595fd RCX: ffff88803304da00
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 00000000ffffffe9 R08: ffffffff81567052 R09: fffffbfff1cfa884
R10: dffffc0000000000 R11: fffffbfff1cfa884 R12: ffffffff8d2cafe8
R13: 1ffffffff1a595fe R14: ffffffff9a789c40 R15: ffff8880724586c0
FS:  0000555590471380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff70c0b6050 CR3: 00000000329c6000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 sock_create net/socket.c:1616 [inline]
 __sys_socket_create net/socket.c:1653 [inline]
 __sys_socket+0x150/0x3c0 net/socket.c:1700
 __do_sys_socket net/socket.c:1714 [inline]
 __se_sys_socket net/socket.c:1712 [inline]
 __x64_sys_socket+0x7a/0x90 net/socket.c:1712
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ff70c074669
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:00007ffffe836c58 EFLAGS: 00000246 ORIG_RAX: 0000000000000029
RAX: ffffffffffffffda RBX: 00007ffffe836c70 RCX: 00007ff70c074669
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 000000000000002b
RBP: 0000000000000001 R08: 00007ffffe8369f7 R09: 00000000000000a0
R10: 0000000000000001 R11: 0000000000000246 R12: 00007ffffe836c6c
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/06 20:24 linux-next 5b913f5d7d7f 3a465482 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING in __sock_create
2024/11/06 19:24 linux-next 5b913f5d7d7f 3a465482 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING in __sock_create
2024/11/06 14:15 linux-next 5b913f5d7d7f 3a465482 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING in __sock_create
2024/11/06 13:36 linux-next 5b913f5d7d7f 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING in __sock_create
* Struck through repros no longer work on HEAD.