syzbot


general protection fault in __io_file_supports_nowait

Status: fixed on 2021/11/10 00:50
Reported-by: syzbot+e51249708aaa9b0e4d2c@syzkaller.appspotmail.com
Fix commit: c6d3d9cbd659 io_uring: fix queueing half-created requests
First crash: 516d, last: 510d

Cause bisection: introduced by (bisect log) :
commit a8295b982c46d4a7c259a4cdd58a2681929068a9
Author: Hao Xu <haoxu@linux.alibaba.com>
Date: Fri Aug 27 09:46:09 2021 +0000

  io_uring: fix failed linkchain code logic

Crash: general protection fault in __io_file_supports_nowait (log)
Repro: C syz .config

Fix bisection: fixed by (bisect log) :
commit c6d3d9cbd659de8f2176b4e4721149c88ac096d4
Author: Pavel Begunkov <asml.silence@gmail.com>
Date: Tue Aug 31 13:13:10 2021 +0000

  io_uring: fix queueing half-created requests

Last patch testing requests:
Created Duration User Patch Repo Result
2021/09/01 02:09 18m axboe@kernel.dk git://git.kernel.dk/linux-block for-5.15/io_uring OK

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000004: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000020-0x0000000000000027]
CPU: 0 PID: 8372 Comm: syz-executor295 Not tainted 5.14.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:file_inode include/linux/fs.h:1344 [inline]
RIP: 0010:__io_file_supports_nowait+0x28/0x3e0 fs/io_uring.c:2785
Code: 00 90 55 41 57 41 56 41 54 53 41 89 f6 49 89 ff 49 bc 00 00 00 00 00 fc ff df e8 73 02 92 ff 49 8d 5f 20 48 89 d8 48 c1 e8 03 <42> 80 3c 20 00 74 08 48 89 df e8 29 55 db ff 48 8b 2b 48 89 e8 48
RSP: 0018:ffffc9000a127430 EFLAGS: 00010202
RAX: 0000000000000004 RBX: 0000000000000020 RCX: ffff8880315b54c0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc9000a127c70 R08: ffffffff81ee1b1b R09: fffff52001424f79
R10: fffff52001424f79 R11: 0000000000000000 R12: dffffc0000000000
R13: 1ffff92001424f7a R14: 0000000000000000 R15: 0000000000000000
FS:  000000000214f300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000084 CR3: 0000000037b7b000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 io_file_supports_nowait fs/io_uring.c:2823 [inline]
 io_read fs/io_uring.c:3440 [inline]
 io_issue_sqe+0xed3/0x9280 fs/io_uring.c:6558
 __io_queue_sqe+0xe3/0x1000 fs/io_uring.c:6864
 tctx_task_work+0x2ad/0x560 fs/io_uring.c:2143
 task_work_run+0x146/0x1c0 kernel/task_work.c:164
 tracehook_notify_signal include/linux/tracehook.h:212 [inline]
 handle_signal_work kernel/entry/common.c:146 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
 exit_to_user_mode_prepare+0x180/0x220 kernel/entry/common.c:209
 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
 syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302
 do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x43f029
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:00007fff43096f28 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa
RAX: 0000000000000200 RBX: 0000000000000003 RCX: 000000000043f029
RDX: 0000000000000000 RSI: 00000000000045f5 RDI: 0000000000000003
RBP: 0000000000403010 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004030a0
R13: 0000000000000000 R14: 00000000004ac018 R15: 0000000000400488
Modules linked in:
---[ end trace ab6ebfa74a5558de ]---
RIP: 0010:file_inode include/linux/fs.h:1344 [inline]
RIP: 0010:__io_file_supports_nowait+0x28/0x3e0 fs/io_uring.c:2785
Code: 00 90 55 41 57 41 56 41 54 53 41 89 f6 49 89 ff 49 bc 00 00 00 00 00 fc ff df e8 73 02 92 ff 49 8d 5f 20 48 89 d8 48 c1 e8 03 <42> 80 3c 20 00 74 08 48 89 df e8 29 55 db ff 48 8b 2b 48 89 e8 48
RSP: 0018:ffffc9000a127430 EFLAGS: 00010202
RAX: 0000000000000004 RBX: 0000000000000020 RCX: ffff8880315b54c0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc9000a127c70 R08: ffffffff81ee1b1b R09: fffff52001424f79
R10: fffff52001424f79 R11: 0000000000000000 R12: dffffc0000000000
R13: 1ffff92001424f7a R14: 0000000000000000 R15: 0000000000000000
FS:  000000000214f300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f057803e088 CR3: 0000000037b7b000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	00 90 55 41 57 41    	add    %dl,0x41574155(%rax)
   6:	56                   	push   %rsi
   7:	41 54                	push   %r12
   9:	53                   	push   %rbx
   a:	41 89 f6             	mov    %esi,%r14d
   d:	49 89 ff             	mov    %rdi,%r15
  10:	49 bc 00 00 00 00 00 	movabs $0xdffffc0000000000,%r12
  17:	fc ff df
  1a:	e8 73 02 92 ff       	callq  0xff920292
  1f:	49 8d 5f 20          	lea    0x20(%r15),%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 20 00       	cmpb   $0x0,(%rax,%r12,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	48 89 df             	mov    %rbx,%rdi
  34:	e8 29 55 db ff       	callq  0xffdb5562
  39:	48 8b 2b             	mov    (%rbx),%rbp
  3c:	48 89 e8             	mov    %rbp,%rax
  3f:	48                   	rex.W

Crashes (13):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-kasan-gce-smack-root 2021/09/01 02:16 upstream b91db6a0b52e 7eb7e152 .config console log report syz C general protection fault in __io_file_supports_nowait
ci-upstream-kasan-gce-root 2021/09/01 01:59 upstream b91db6a0b52e 7eb7e152 .config console log report syz C general protection fault in __io_file_supports_nowait
ci-upstream-kasan-gce 2021/09/06 05:53 upstream 0319b848b155 d236a457 .config console log report info general protection fault in __io_file_supports_nowait
ci-upstream-kasan-gce-smack-root 2021/09/05 02:00 upstream f1583cb1be35 d236a457 .config console log report info general protection fault in __io_file_supports_nowait
ci-upstream-kasan-gce-selinux-root 2021/09/05 01:44 upstream f1583cb1be35 d236a457 .config console log report info general protection fault in __io_file_supports_nowait
ci-upstream-kasan-gce-root 2021/09/03 20:24 upstream a9c9a6f741cd f62a5829 .config console log report info general protection fault in __io_file_supports_nowait
ci-upstream-kasan-gce-root 2021/09/02 20:27 upstream 4ac6d90867a4 15cea0a3 .config console log report info general protection fault in __io_file_supports_nowait
ci-upstream-kasan-gce 2021/09/02 18:41 upstream 4ac6d90867a4 15cea0a3 .config console log report info general protection fault in __io_file_supports_nowait
ci-upstream-kasan-gce-smack-root 2021/09/01 01:51 upstream b91db6a0b52e 7eb7e152 .config console log report info general protection fault in __io_file_supports_nowait
ci-upstream-kasan-gce-root 2021/09/01 01:28 upstream b91db6a0b52e 7eb7e152 .config console log report info general protection fault in __io_file_supports_nowait
ci-upstream-kasan-gce 2021/08/31 20:31 upstream 9c849ce86e0f 7eb7e152 .config console log report info general protection fault in __io_file_supports_nowait
ci-upstream-kasan-gce-selinux-root 2021/08/31 19:37 upstream 9c849ce86e0f 7eb7e152 .config console log report info general protection fault in __io_file_supports_nowait
ci-upstream-kasan-gce 2021/08/31 19:07 upstream 9c849ce86e0f 7eb7e152 .config console log report info general protection fault in __io_file_supports_nowait
* Struck through repros no longer work on HEAD.