syzbot


UBSAN: array-index-out-of-bounds in io_setup_async_msg

Status: fixed on 2023/12/21 03:45
Subsystems: io-uring
[Documentation on labels]
Reported-by: syzbot+a4c6e5ef999b68b26ed1@syzkaller.appspotmail.com
Fix commit: c21a8027ad8a io_uring/net: fix iter retargeting for selected buf
First crash: 227d, last: 227d
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: UBSAN: array-index-out-of-bounds in io_setup_async_msg (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] io_uring/net: fix iter retargeting for selected buf 2 (2) 2023/09/14 16:05
[syzbot] [io-uring?] UBSAN: array-index-out-of-bounds in io_setup_async_msg 5 (10) 2023/09/14 16:04
Last patch testing requests (4)
Created Duration User Patch Repo Result
2023/09/14 15:05 16m asml.silence@gmail.com https://github.com/isilence/linux.git syz-test/netmsg-init-base report log
2023/09/14 15:05 22m asml.silence@gmail.com https://github.com/isilence/linux.git syz-test/netmsg-init OK log
2023/09/14 14:10 0m asml.silence@gmail.com https://github.com/isilence/linux.git netmsg-init error OK
2023/09/14 14:08 0m asml.silence@gmail.com https://github.com/isilence/linux.git netmsg-init-base error OK

Sample crash report:
================================================================================
UBSAN: array-index-out-of-bounds in io_uring/net.c:189:55
index 3779567444058 is out of range for type 'iovec [8]'
CPU: 1 PID: 5039 Comm: syz-executor396 Not tainted 6.6.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x125/0x1b0 lib/dump_stack.c:106
 ubsan_epilogue lib/ubsan.c:217 [inline]
 __ubsan_handle_out_of_bounds+0x111/0x150 lib/ubsan.c:348
 io_setup_async_msg+0x2a0/0x2b0 io_uring/net.c:189
 io_recvmsg+0x169f/0x2170 io_uring/net.c:781
 io_issue_sqe+0x54a/0xd80 io_uring/io_uring.c:1878
 io_queue_sqe io_uring/io_uring.c:2063 [inline]
 io_submit_sqe io_uring/io_uring.c:2323 [inline]
 io_submit_sqes+0x96c/0x1ed0 io_uring/io_uring.c:2438
 __do_sys_io_uring_enter+0x14ea/0x2650 io_uring/io_uring.c:3647
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f8af8d7c4e9
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:00007fff24b82fa8 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa
RAX: ffffffffffffffda RBX: 0000000000001592 RCX: 00007f8af8d7c4e9
RDX: 0000000000000000 RSI: 0000000000007689 RDI: 0000000000000003
RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fff24b83188 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
================================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/12 14:47 upstream 0bb80ecc33a8 59da8366 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce UBSAN: array-index-out-of-bounds in io_setup_async_msg
2023/09/12 14:11 upstream 0bb80ecc33a8 59da8366 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root UBSAN: array-index-out-of-bounds in io_setup_async_msg
2023/09/12 13:31 upstream 0bb80ecc33a8 59da8366 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root UBSAN: array-index-out-of-bounds in io_setup_async_msg
* Struck through repros no longer work on HEAD.