Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4169926rdb; Thu, 14 Sep 2023 14:06:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpO1qwu0KPqZf4nsT1wc257Vf7BKULsfnCChXvChkGZfjXT8mxz0bDJGihT81C0DX+mhyU X-Received: by 2002:a17:903:11c8:b0:1c3:bbad:9b7b with SMTP id q8-20020a17090311c800b001c3bbad9b7bmr7066775plh.29.1694725612669; Thu, 14 Sep 2023 14:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694725612; cv=none; d=google.com; s=arc-20160816; b=YfA/RA9E4z1UdmsPYwq99XBDVOvpRWUkdOF/uSTujv5jA5Ix2a2mGk9z/QDbLu7EwO Ay8DxKXhjI0GI07RJc61JSnK/GyN2LPfoGKhSkiy/+Fm2V5WjFRAUebgSByL7gwDkkGr kbQU+LTmVj6+UCbrydDAh1mBSJtxR2/+A2nXpIve7E2LbY8WBb/V1oUiNJdE5hluX0Db KJV16H2oDcLJEiULd64ZQ6Fn1eE+l86bf5ljB65dTbwEPmlPwC+uRKiNzqjWi1F0Fuwm TMp+E3G2tWI+VEzwXFQ7YJrRTVO4d1KeC9Da5sg+VP088U5J47GY9xSwnDMM1Do8Snqg ps9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=rlj6KG4cuBzPFv7nUXRHtkrRKhmI1+rFUD2aKqXMXLs=; fh=4bAwdfA+uJ5wEeFI/fgdLlzi/HAwY3X/2oNjAZiPzoM=; b=uh0mk8r0doOAoRFaCl9okChLanA46B91gpaLF5FyFxNV2J1T01KpIKavd6NtRUoxiG iNvkpdw/btXZGTnrYpI3+YTo8jbdK/vwIMhN5gRbl2QpasOkAwP0MJri5gb9T7UtV+nf XExTww/rhPj3v4U2xcsAl48pe4lB5CXVoNs6NDiC7Ze8IUYIaWRvqNMc3DC1DBoc2L7W kWqeMTtpONFiPzj4/S4SZ5Jy2sZ9RH10wfngpk3b3MYDHGjZOjNjtrYfSMDJ2TfZAQPu qNMv575blJ22V5tbiLazUyGza0WR0xqcmtv+5G0gIX1/5NUoGxx6F9RpIWcLNDrdyGsD qGzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=NYZl8hFa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id iz11-20020a170902ef8b00b001aff514a8f0si2118014plb.534.2023.09.14.14.06.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 14:06:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=NYZl8hFa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 553DE80C8DD4; Thu, 14 Sep 2023 08:05:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240347AbjINPFb (ORCPT + 99 others); Thu, 14 Sep 2023 11:05:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237526AbjINPFa (ORCPT ); Thu, 14 Sep 2023 11:05:30 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C13DA8; Thu, 14 Sep 2023 08:05:26 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-502a25ab777so1782001e87.2; Thu, 14 Sep 2023 08:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694703925; x=1695308725; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=rlj6KG4cuBzPFv7nUXRHtkrRKhmI1+rFUD2aKqXMXLs=; b=NYZl8hFay+mos4l0Pdpapcz6gVcPhBMQq4mYIwb+KeFLanmGk0DDkqd5t01pM12Mqh KsAInGwerrqNzEMLkHiLn4lA45NQM0Iq9vZLGYfFD5OLnOV+E8GHYzs5s4EC4DLNinNa M0ZDx/wYWIbUWSq9mjANK8nxefcEwRsuXHyhswf7hqTt8y/Z1bhmydm16Zn+tGfcofI1 fqmxexy9nEcqlBqLrECwWTrU1GNlHj8ZW/R58eWbvMJsiFz1/8KhGM/LZ846hhxhHnZO BpoUlZtnaF8CSmEnod8dcnz7xYnnM+RfJR6jADCK8Mhd9DAA0+rUqkIcOSvxqjXCTbGZ Af1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694703925; x=1695308725; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rlj6KG4cuBzPFv7nUXRHtkrRKhmI1+rFUD2aKqXMXLs=; b=om2yqv4W9suz18MHmmcxHGyrQodI91K1zD5aZMBot1o0FM9Hv2BxuTdZwJRUx29HF8 X8eGpwVMBzPXf+Bq8ppkvDL0j5mgFUz5T5voG8GW6LRO/lHqi7s2/YfrbVCczKZqLc8J gc0t5Dphtc+NQArhejGuNM03dp8+m0agPgDAc5jZGgQsmzhTvLD44xEGQ+bEGavVjGxj SObx1UjmvPebJZBPn6NrVMei1Xt8AmhjBoteWJLspC2YDHDz8GOf5YJpsl2r7H4bu81v SVqKgWDTCcJxKf2KHp0rrJNd39keEt+iglL2smOJ2B8Br4384zg3mO0ZMk+IvEfHlq1M XKDQ== X-Gm-Message-State: AOJu0YyiVm4TeTeP8Qmpt4Bj8ZlZn+0wVJ3FPeSc09/VlLhKmqq8SA4/ z0X18MKdaiXV5LsQ8LQNdQ4= X-Received: by 2002:a05:6512:39cc:b0:4fe:8c07:98eb with SMTP id k12-20020a05651239cc00b004fe8c0798ebmr5203081lfu.51.1694703924392; Thu, 14 Sep 2023 08:05:24 -0700 (PDT) Received: from [192.168.8.100] ([148.252.128.120]) by smtp.gmail.com with ESMTPSA id a9-20020aa7d909000000b0052889d090bfsm1031987edr.79.2023.09.14.08.05.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Sep 2023 08:05:24 -0700 (PDT) Message-ID: <6fd7f735-6262-73cc-c5d2-b508c25b360d@gmail.com> Date: Thu, 14 Sep 2023 16:03:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [syzbot] [io-uring?] UBSAN: array-index-out-of-bounds in io_setup_async_msg Content-Language: en-US From: Pavel Begunkov To: syzbot , axboe@kernel.dk, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com References: <0000000000002770be06053c7757@google.com> <864c84f9-5acc-132d-0cd8-826d041cff96@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 14 Sep 2023 08:05:55 -0700 (PDT) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 >>>> 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: syzbot+a4c6e5ef999b68b26ed1@syzkaller.appspotmail.com >>>> 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: >>>>   >>>>   __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