syzbot


general protection fault in io_uring_show_fdinfo

Status: fixed on 2023/10/12 12:48
Subsystems: io-uring
[Documentation on labels]
Reported-by: syzbot+216e2ea6e0bf4a0acdd7@syzkaller.appspotmail.com
Fix commit: 32f5dea040ee io_uring/fdinfo: only print ->sq_array[] if it's there
First crash: 429d, last: 420d
Cause bisection: introduced by (bisect log) :
commit 2af89abda7d9c2aeb573677e2c498ddb09f8058a
Author: Pavel Begunkov <asml.silence@gmail.com>
Date: Thu Aug 24 22:53:32 2023 +0000

  io_uring: add option to remove SQ indirection

Crash: BUG: unable to handle kernel NULL pointer dereference in io_uring_show_fdinfo (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] io_uring/fdinfo: only print ->sq_array[] if it's there 2 (2) 2023/09/01 20:58
[syzbot] [io-uring?] general protection fault in io_uring_show_fdinfo 1 (2) 2023/09/01 19:59
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in io_uring_show_fdinfo (2) io-uring C done 19 2d17h 1d19h 0/28 upstream: reported C repro on 2024/11/01 18:28
upstream KASAN: slab-out-of-bounds Read in io_uring_show_fdinfo io-uring C done 5 749d 755d 22/28 fixed on 2023/02/24 13:50

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 5026 Comm: syz-executor249 Not tainted 6.5.0-syzkaller-09276-g99d99825fc07 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
RIP: 0010:io_uring_show_fdinfo+0x391/0x1790 io_uring/fdinfo.c:96
Code: 00 00 00 42 80 3c 28 00 74 0f 48 8b 7c 24 30 e8 d5 9d 22 f7 48 8b 4c 24 30 44 21 f3 48 c1 e3 02 48 03 19 48 89 d8 48 c1 e8 03 <42> 8a 04 28 84 c0 0f 85 64 02 00 00 8b 1b 89 df 44 89 f6 e8 c7 c9
RSP: 0018:ffffc900038ffc20 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8880299e60d0
RDX: ffff8880262f9dc0 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc900038ffd98 R08: ffffffff8ac4995f R09: 1ffff11004f01013
R10: dffffc0000000000 R11: ffffed1004f01014 R12: ffff888021153de0
R13: dffffc0000000000 R14: 0000000000003fff R15: 0000000000000001
FS:  000055555700b480(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f6f2394f653 CR3: 0000000029588000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 seq_show+0x57d/0x6a0 fs/proc/fd.c:70
 traverse+0x1d5/0x530 fs/seq_file.c:111
 seq_lseek+0x129/0x240 fs/seq_file.c:323
 vfs_llseek fs/read_write.c:289 [inline]
 ksys_lseek fs/read_write.c:302 [inline]
 __do_sys_lseek fs/read_write.c:313 [inline]
 __se_sys_lseek fs/read_write.c:311 [inline]
 __x64_sys_lseek+0x14f/0x1d0 fs/read_write.c:311
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f6f238f2fe9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc7fc29dc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000008
RAX: ffffffffffffffda RBX: 00007ffc7fc29de0 RCX: 00007f6f238f2fe9
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc7fc2a048 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:io_uring_show_fdinfo+0x391/0x1790 io_uring/fdinfo.c:96
Code: 00 00 00 42 80 3c 28 00 74 0f 48 8b 7c 24 30 e8 d5 9d 22 f7 48 8b 4c 24 30 44 21 f3 48 c1 e3 02 48 03 19 48 89 d8 48 c1 e8 03 <42> 8a 04 28 84 c0 0f 85 64 02 00 00 8b 1b 89 df 44 89 f6 e8 c7 c9
RSP: 0018:ffffc900038ffc20 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8880299e60d0
RDX: ffff8880262f9dc0 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc900038ffd98 R08: ffffffff8ac4995f R09: 1ffff11004f01013
R10: dffffc0000000000 R11: ffffed1004f01014 R12: ffff888021153de0
R13: dffffc0000000000 R14: 0000000000003fff R15: 0000000000000001
FS:  000055555700b480(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f6f2394f653 CR3: 0000000029588000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	00 00                	add    %al,(%rax)
   2:	00 42 80             	add    %al,-0x80(%rdx)
   5:	3c 28                	cmp    $0x28,%al
   7:	00 74 0f 48          	add    %dh,0x48(%rdi,%rcx,1)
   b:	8b 7c 24 30          	mov    0x30(%rsp),%edi
   f:	e8 d5 9d 22 f7       	call   0xf7229de9
  14:	48 8b 4c 24 30       	mov    0x30(%rsp),%rcx
  19:	44 21 f3             	and    %r14d,%ebx
  1c:	48 c1 e3 02          	shl    $0x2,%rbx
  20:	48 03 19             	add    (%rcx),%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 8a 04 28          	mov    (%rax,%r13,1),%al <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	0f 85 64 02 00 00    	jne    0x29a
  36:	8b 1b                	mov    (%rbx),%ebx
  38:	89 df                	mov    %ebx,%edi
  3a:	44 89 f6             	mov    %r14d,%esi
  3d:	e8                   	.byte 0xe8
  3e:	c7                   	(bad)
  3f:	c9                   	leave

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/01 11:02 upstream 99d99825fc07 696ea0d2 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in io_uring_show_fdinfo
2023/09/01 09:02 upstream b97d64c72259 696ea0d2 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in io_uring_show_fdinfo
2023/09/09 07:20 upstream a48fa7efaf11 6654cf89 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in io_uring_show_fdinfo
2023/09/08 06:49 upstream 4a0fc73da97e 72324844 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in io_uring_show_fdinfo
2023/09/07 18:43 upstream 7ba2090ca64e 72324844 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in io_uring_show_fdinfo
2023/09/07 15:10 upstream 7ba2090ca64e 72324844 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in io_uring_show_fdinfo
2023/09/05 20:12 upstream 3f86ed6ec0b3 8bc9053e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in io_uring_show_fdinfo
2023/09/05 10:06 upstream 3f86ed6ec0b3 8bc9053e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in io_uring_show_fdinfo
2023/09/03 16:41 upstream 92901222f83d 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in io_uring_show_fdinfo
2023/09/03 09:27 upstream 92901222f83d 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in io_uring_show_fdinfo
2023/09/02 09:41 upstream b84acc11b1c9 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in io_uring_show_fdinfo
2023/09/01 20:35 upstream 99d99825fc07 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in io_uring_show_fdinfo
2023/09/01 12:02 upstream 99d99825fc07 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in io_uring_show_fdinfo
2023/09/01 08:17 upstream b97d64c72259 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in io_uring_show_fdinfo
2023/09/05 02:19 upstream 708283abf896 8bc9053e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in io_uring_show_fdinfo
2023/09/10 08:25 linux-next af3c30d33476 6654cf89 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in io_uring_show_fdinfo
2023/09/02 16:36 linux-next a47fc304d2b6 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in io_uring_show_fdinfo
* Struck through repros no longer work on HEAD.