syzbot


general protection fault in io_get_cqe_overflow

Status: fixed on 2023/12/21 03:45
Subsystems: io-uring
[Documentation on labels]
Reported-by: syzbot+efc45d4e7ba6ab4ef1eb@syzkaller.appspotmail.com
Fix commit: 1658633c0465 io_uring: ensure io_lockdep_assert_cq_locked() handles disabled rings
First crash: 209d, last: 209d
Cause bisection: introduced by (bisect log) :
commit f26cc9593581bd734c846bf827401350b36dc3c9
Author: Pavel Begunkov <asml.silence@gmail.com>
Date: Wed Jan 4 01:34:57 2023 +0000

  io_uring: lockdep annotate CQ locking

Crash: BUG: unable to handle kernel NULL pointer dereference in io_get_cqe (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] [io-uring?] general protection fault in io_get_cqe_overflow 2 (4) 2023/10/03 02:19
[PATCH] io_uring: ensure io_lockdep_assert_cq_locked() handles disabled rings 1 (1) 2023/10/03 01:57
Last patch testing requests (1)
Created Duration User Patch Repo Result
2023/10/03 02:02 16m axboe@kernel.dk git://git.kernel.dk/linux.git io_uring-6.6 OK log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000005: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f]
CPU: 1 PID: 5030 Comm: syz-executor742 Not tainted 6.6.0-rc3-syzkaller-00146-g9f3ebbef746f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
RIP: 0010:io_get_cqe_overflow+0x1f2/0x570 io_uring/io_uring.h:116
Code: fc ff df 80 3c 08 00 74 08 48 89 ef e8 67 54 b2 fd 4c 8b 75 00 49 8d 6e 2c 48 89 e8 48 c1 e8 03 48 bb 00 00 00 00 00 fc ff df <0f> b6 04 18 84 c0 0f 85 18 03 00 00 44 8b 65 00 41 83 e4 04 31 ff
RSP: 0018:ffffc9000398f930 EFLAGS: 00010207
RAX: 0000000000000005 RBX: dffffc0000000000 RCX: dffffc0000000000
RDX: ffff888017a4d940 RSI: 0000000000000020 RDI: 0000000000000000
RBP: 000000000000002c R08: ffffffff84362701 R09: fffff52000731f20
R10: dffffc0000000000 R11: fffff52000731f20 R12: 1ffff1100410b400
R13: dffffc0000000000 R14: 0000000000000000 R15: ffffc9000398f9c0
FS:  0000555555943380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001380 CR3: 000000007d529000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 io_get_cqe io_uring/io_uring.h:132 [inline]
 io_fill_cqe_aux io_uring/io_uring.c:884 [inline]
 __io_post_aux_cqe+0xe7/0x440 io_uring/io_uring.c:931
 io_rsrc_put_work io_uring/rsrc.c:156 [inline]
 io_rsrc_node_ref_zero+0x219/0x570 io_uring/rsrc.c:191
 io_put_rsrc_node io_uring/rsrc.h:112 [inline]
 io_queue_rsrc_removal+0x4a0/0x5c0 io_uring/rsrc.c:667
 __io_sqe_buffers_update io_uring/rsrc.c:469 [inline]
 __io_register_rsrc_update+0x828/0x1430 io_uring/rsrc.c:499
 io_register_rsrc_update+0x1cd/0x220 io_uring/rsrc.c:530
 __do_sys_io_uring_register io_uring/io_uring.c:4587 [inline]
 __se_sys_io_uring_register+0x78f/0x1470 io_uring/io_uring.c:4547
 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:0x7fddb16c14e9
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:00007ffe58601a08 EFLAGS: 00000246 ORIG_RAX: 00000000000001ab
RAX: ffffffffffffffda RBX: 0000000000006ba5 RCX: 00007fddb16c14e9
RDX: 0000000020001600 RSI: 0000000000000010 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00000000000ac5f8 R09: 00000000000ac5f8
R10: 0000000000000020 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe58601bd8 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:io_get_cqe_overflow+0x1f2/0x570 io_uring/io_uring.h:116
Code: fc ff df 80 3c 08 00 74 08 48 89 ef e8 67 54 b2 fd 4c 8b 75 00 49 8d 6e 2c 48 89 e8 48 c1 e8 03 48 bb 00 00 00 00 00 fc ff df <0f> b6 04 18 84 c0 0f 85 18 03 00 00 44 8b 65 00 41 83 e4 04 31 ff
RSP: 0018:ffffc9000398f930 EFLAGS: 00010207
RAX: 0000000000000005 RBX: dffffc0000000000 RCX: dffffc0000000000
RDX: ffff888017a4d940 RSI: 0000000000000020 RDI: 0000000000000000
RBP: 000000000000002c R08: ffffffff84362701 R09: fffff52000731f20
R10: dffffc0000000000 R11: fffff52000731f20 R12: 1ffff1100410b400
R13: dffffc0000000000 R14: 0000000000000000 R15: ffffc9000398f9c0
FS:  0000555555943380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001380 CR3: 000000007d529000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 2 bytes skipped:
   0:	df 80 3c 08 00 74    	filds  0x7400083c(%rax)
   6:	08 48 89             	or     %cl,-0x77(%rax)
   9:	ef                   	out    %eax,(%dx)
   a:	e8 67 54 b2 fd       	call   0xfdb25476
   f:	4c 8b 75 00          	mov    0x0(%rbp),%r14
  13:	49 8d 6e 2c          	lea    0x2c(%r14),%rbp
  17:	48 89 e8             	mov    %rbp,%rax
  1a:	48 c1 e8 03          	shr    $0x3,%rax
  1e:	48 bb 00 00 00 00 00 	movabs $0xdffffc0000000000,%rbx
  25:	fc ff df
* 28:	0f b6 04 18          	movzbl (%rax,%rbx,1),%eax <-- trapping instruction
  2c:	84 c0                	test   %al,%al
  2e:	0f 85 18 03 00 00    	jne    0x34c
  34:	44 8b 65 00          	mov    0x0(%rbp),%r12d
  38:	41 83 e4 04          	and    $0x4,%r12d
  3c:	31 ff                	xor    %edi,%edi

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/30 09:56 upstream 9f3ebbef746f 8e26a358 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in io_get_cqe_overflow
2023/09/30 09:30 upstream 9f3ebbef746f 8e26a358 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in io_get_cqe_overflow
* Struck through repros no longer work on HEAD.