syzbot


general protection fault in splice_to_socket

Status: fixed on 2023/09/28 17:51
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+f9e28a23426ac3b24f20@syzkaller.appspotmail.com
Fix commit: ca2d49f77ce4 splice, net: Fix splice_to_socket() to handle pipe bufs larger than a page
First crash: 322d, last: 317d
Cause bisection: introduced by (bisect log) :
commit 2dc334f1a63a8839b88483a3e73c0f27c9c1791c
Author: David Howells <dhowells@redhat.com>
Date: Wed Jun 7 18:19:09 2023 +0000

  splice, net: Use sendmsg(MSG_SPLICE_PAGES) rather than ->sendpage()

Crash: general protection fault in splice_to_socket (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH net-next] splice, net: Fix splice_to_socket() to handle pipe bufs larger than a page 2 (2) 2023/06/16 06:00
[syzbot] [fs?] general protection fault in splice_to_socket 2 (4) 2023/06/14 10:02
Last patch testing requests (1)
Created Duration User Patch Repo Result
2023/06/14 09:00 29m dhowells@redhat.com patch git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git main OK log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 1 PID: 5007 Comm: syz-executor330 Not tainted 6.4.0-rc5-syzkaller-00915-ge7c5433c5aaa #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
RIP: 0010:pipe_buf_release include/linux/pipe_fs_i.h:203 [inline]
RIP: 0010:splice_to_socket+0xa91/0xe30 fs/splice.c:933
Code: 10 48 89 f8 48 c1 e8 03 42 80 3c 28 00 0f 85 19 03 00 00 49 8b 46 10 49 c7 46 10 00 00 00 00 48 8d 78 08 48 89 fa 48 c1 ea 03 <42> 80 3c 2a 00 0f 85 e3 02 00 00 4c 89 f6 4c 89 e7 ff 50 08 83 44
RSP: 0018:ffffc90003adfa28 EFLAGS: 00010202
RAX: 0000000000000000 RBX: 0000000000008001 RCX: 0000000000000000
RDX: 0000000000000001 RSI: ffffffff81f4e014 RDI: 0000000000000008
RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000000 R11: 1ffffffff2186c9b R12: ffff88802819f000
R13: dffffc0000000000 R14: ffff888077c05028 R15: 0000000000008001
FS:  00007f82b229b700(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f82b227a718 CR3: 0000000075e14000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 do_splice_from fs/splice.c:969 [inline]
 do_splice+0xb8c/0x1e50 fs/splice.c:1309
 __do_splice+0x14e/0x270 fs/splice.c:1387
 __do_sys_splice fs/splice.c:1598 [inline]
 __se_sys_splice fs/splice.c:1580 [inline]
 __x64_sys_splice+0x19c/0x250 fs/splice.c:1580
 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:0x7f82b22e8fc9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 14 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:00007f82b229b2f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00007f82b2371428 RCX: 00007f82b22e8fc9
RDX: 0000000000000008 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00007f82b2371420 R08: 0000000002000007 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f82b237142c
R13: 00007f82b233f004 R14: 0100000000000000 R15: 0000000000022000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:pipe_buf_release include/linux/pipe_fs_i.h:203 [inline]
RIP: 0010:splice_to_socket+0xa91/0xe30 fs/splice.c:933
Code: 10 48 89 f8 48 c1 e8 03 42 80 3c 28 00 0f 85 19 03 00 00 49 8b 46 10 49 c7 46 10 00 00 00 00 48 8d 78 08 48 89 fa 48 c1 ea 03 <42> 80 3c 2a 00 0f 85 e3 02 00 00 4c 89 f6 4c 89 e7 ff 50 08 83 44
RSP: 0018:ffffc90003adfa28 EFLAGS: 00010202
RAX: 0000000000000000 RBX: 0000000000008001 RCX: 0000000000000000
RDX: 0000000000000001 RSI: ffffffff81f4e014 RDI: 0000000000000008
RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000000 R11: 1ffffffff2186c9b R12: ffff88802819f000
R13: dffffc0000000000 R14: ffff888077c05028 R15: 0000000000008001
FS:  00007f82b229b700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa5f3ff2304 CR3: 0000000075e14000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	10 48 89             	adc    %cl,-0x77(%rax)
   3:	f8                   	clc
   4:	48 c1 e8 03          	shr    $0x3,%rax
   8:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1)
   d:	0f 85 19 03 00 00    	jne    0x32c
  13:	49 8b 46 10          	mov    0x10(%r14),%rax
  17:	49 c7 46 10 00 00 00 	movq   $0x0,0x10(%r14)
  1e:	00
  1f:	48 8d 78 08          	lea    0x8(%rax),%rdi
  23:	48 89 fa             	mov    %rdi,%rdx
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	42 80 3c 2a 00       	cmpb   $0x0,(%rdx,%r13,1) <-- trapping instruction
  2f:	0f 85 e3 02 00 00    	jne    0x318
  35:	4c 89 f6             	mov    %r14,%rsi
  38:	4c 89 e7             	mov    %r12,%rdi
  3b:	ff 50 08             	callq  *0x8(%rax)
  3e:	83                   	.byte 0x83
  3f:	44                   	rex.R

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/09 19:55 net-next e7c5433c5aaa 7086cdb9 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in splice_to_socket
2023/06/09 17:26 net-next e7c5433c5aaa 7086cdb9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in splice_to_socket
2023/06/15 10:47 linux-next 925294c9aa18 76decb82 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in splice_to_socket
2023/06/13 11:34 linux-next 1f6ce8392d6f 749afb64 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in splice_to_socket
* Struck through repros no longer work on HEAD.