public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: syzbot <[email protected]>,
	[email protected], [email protected],
	[email protected], [email protected]
Subject: Re: [syzbot] [io-uring?] UBSAN: array-index-out-of-bounds in io_setup_async_msg
Date: Thu, 14 Sep 2023 16:03:15 +0100	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 9/14/23 15:08, Pavel Begunkov wrote:
> On 9/14/23 15:06, Pavel Begunkov wrote:
>> On 9/13/23 14:10, Pavel Begunkov wrote:
>>> On 9/13/23 13:11, syzbot wrote:
>>>> Hello,
>>>>
>>>> syzbot found the following issue on:
>>>>
>>>> HEAD commit:    0bb80ecc33a8 Linux 6.6-rc1
>>>> git tree:       upstream
>>>> console+strace: https://syzkaller.appspot.com/x/log.txt?x=12d1eb78680000
>>>> kernel config:  https://syzkaller.appspot.com/x/.config?x=f4894cf58531f
>>>> dashboard link: https://syzkaller.appspot.com/bug?extid=a4c6e5ef999b68b26ed1
>>>> compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
>>>> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=16613002680000
>>>> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13912e30680000
>>>>
>>>> Downloadable assets:
>>>> disk image: https://storage.googleapis.com/syzbot-assets/eeb0cac260c7/disk-0bb80ecc.raw.xz
>>>> vmlinux: https://storage.googleapis.com/syzbot-assets/a3c360110254/vmlinux-0bb80ecc.xz
>>>> kernel image: https://storage.googleapis.com/syzbot-assets/22b81065ba5f/bzImage-0bb80ecc.xz
>>>>
>>>> The issue was bisected to:
>>>>
>>>> commit 2af89abda7d9c2aeb573677e2c498ddb09f8058a
>>>> Author: Pavel Begunkov <[email protected]>
>>>> Date:   Thu Aug 24 22:53:32 2023 +0000
>>>>
>>>>      io_uring: add option to remove SQ indirection
>>>>
>>>> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=15892e30680000
>>>> final oops:     https://syzkaller.appspot.com/x/report.txt?x=17892e30680000
>>>> console output: https://syzkaller.appspot.com/x/log.txt?x=13892e30680000
>>>>
>>>> IMPORTANT: if you fix the issue, please add the following tag to the commit:
>>>> Reported-by: [email protected]
>>>> Fixes: 2af89abda7d9 ("io_uring: add option to remove SQ indirection")
>>>>
>>>> ================================================================================
>>>> 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
>>>
>>> Which is
>>>
>>> /* if were using fast_iov, set it to the new one */
>>> if (iter_is_iovec(&kmsg->msg.msg_iter) && !kmsg->free_iov) {
>>>      size_t fast_idx = iter_iov(&kmsg->msg.msg_iter) - kmsg->fast_iov;
>>>      async_msg->msg.msg_iter.__iov = &async_msg->fast_iov[fast_idx];
>>> }
>>>
>>> The bisection doesn't immediately make sense, I'll try
>>> it out
>>
>> #syz test: https://github.com/isilence/linux.git netmsg-init-base
>>
>> First just test upstream because I'm curious about reproducibility
> 
> Couldn't repro myself, I think this is the fix

#syz test: https://github.com/isilence/linux.git syz-test/netmsg-init

-- 
Pavel Begunkov

  parent reply	other threads:[~2023-09-14 15:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 12:11 [syzbot] [io-uring?] UBSAN: array-index-out-of-bounds in io_setup_async_msg syzbot
2023-09-13 13:10 ` Pavel Begunkov
2023-09-14 14:06   ` Pavel Begunkov
2023-09-14 14:08     ` Pavel Begunkov
2023-09-14 14:57       ` syzbot
2023-09-14 15:03       ` Pavel Begunkov [this message]
2023-09-14 15:46         ` syzbot
2023-09-14 14:55     ` syzbot
2023-09-14 15:03     ` Pavel Begunkov
2023-09-14 16:04       ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox