syzbot


WARNING in scm_recv

Status: fixed on 2023/09/28 17:51
Subsystems: net
[Documentation on labels]
Fix commit: 603fc57ab70c af_unix: Skip SCM_PIDFD if scm->pid is NULL.
First crash: 324d, last: 321d
Cause bisection: introduced by (bisect log) :
commit 5e2ff6704a275be009be8979af17c52361b79b89
Author: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Date: Thu Jun 8 20:26:25 2023 +0000

  scm: add SO_PASSPIDFD and SCM_PIDFD

Crash: WARNING in scm_recv (log)
Repro: C syz .config
  

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 5009 at include/net/scm.h:138 scm_pidfd_recv include/net/scm.h:138 [inline]
WARNING: CPU: 0 PID: 5009 at include/net/scm.h:138 scm_recv.constprop.0+0x755/0x850 include/net/scm.h:177
Modules linked in:
CPU: 0 PID: 5009 Comm: syz-executor242 Not tainted 6.4.0-rc7-syzkaller-01944-g3674fbf0451d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
RIP: 0010:scm_pidfd_recv include/net/scm.h:138 [inline]
RIP: 0010:scm_recv.constprop.0+0x755/0x850 include/net/scm.h:177
Code: 0e f9 e9 55 fd ff ff e8 29 f5 0e f9 e9 7f fd ff ff e8 1f f5 0e f9 e9 39 fb ff ff e8 15 f5 0e f9 e9 02 fd ff ff e8 3b e3 bb f8 <0f> 0b e9 f9 fb ff ff e8 1f f5 0e f9 e9 2d f9 ff ff e8 15 f5 0e f9
RSP: 0018:ffffc900039df660 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888078229800 RCX: 0000000000000000
RDX: ffff888027243b80 RSI: ffffffff88c86625 RDI: 0000000000000007
RBP: ffffc900039df818 R08: 0000000000000007 R09: 0000000000000013
R10: 00000000000000e1 R11: 0000000000000001 R12: ffffc900039dfdb0
R13: 0000000000000000 R14: ffff888078229808 R15: 1ffff9200073becc
FS:  0000555556c9e300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020005b88 CR3: 00000000748b6000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 unix_stream_read_generic+0x604/0x2030 net/unix/af_unix.c:2811
 unix_stream_recvmsg+0x18b/0x1c0 net/unix/af_unix.c:2861
 sock_recvmsg_nosec net/socket.c:1019 [inline]
 sock_recvmsg+0xe2/0x160 net/socket.c:1040
 ____sys_recvmsg+0x210/0x5a0 net/socket.c:2712
 ___sys_recvmsg+0xf2/0x180 net/socket.c:2754
 do_recvmmsg+0x25e/0x6f0 net/socket.c:2848
 __sys_recvmmsg net/socket.c:2927 [inline]
 __do_sys_recvmmsg net/socket.c:2950 [inline]
 __se_sys_recvmmsg net/socket.c:2943 [inline]
 __x64_sys_recvmmsg+0x20f/0x260 net/socket.c:2943
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f97f8e01bb9
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:00007ffc8f993a58 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f97f8e01bb9
RDX: 0000000000000001 RSI: 0000000020005b80 RDI: 0000000000000004
RBP: 00007f97f8dc5d60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000140 R11: 0000000000000246 R12: 00007f97f8dc5df0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/30 22:12 net 3674fbf0451d 01298212 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in scm_recv
2023/07/04 05:26 net 3674fbf0451d 6e553898 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in scm_recv
2023/07/03 06:25 net 3674fbf0451d bfc47836 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in scm_recv
2023/07/02 09:10 net 3674fbf0451d bfc47836 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in scm_recv
2023/06/30 21:52 net 3674fbf0451d 01298212 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in scm_recv
2023/06/30 21:52 net 3674fbf0451d 01298212 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in scm_recv
2023/06/30 21:51 net 3674fbf0451d 01298212 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in scm_recv
2023/06/30 21:51 net 3674fbf0451d 01298212 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in scm_recv
* Struck through repros no longer work on HEAD.