Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2880700rwb; Mon, 5 Sep 2022 03:05:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR4/0Wxp2prhBFCt+eRWnTs9JJZe+Cg+DHERWF4gZ47lgHY3dI1beVLZzNg8D4tjzzWZQIrF X-Received: by 2002:a05:6a00:1a0c:b0:528:6baa:a2e3 with SMTP id g12-20020a056a001a0c00b005286baaa2e3mr49608700pfv.27.1662372346428; Mon, 05 Sep 2022 03:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662372346; cv=none; d=google.com; s=arc-20160816; b=vUo/sQSVANB8GoA9ZUJBWHRWVqP74IRRXH2GP4DIVLyPlz12yUq4sLOLiJsNCNwLsS UKsK+I0gEWmct2nr3ymiXguKZr/BkrBMKA5fuKKsZ0Zg3Yd8sR/jl9o4sBdwfv4PJ6/2 aPh5G5sFxLZnmarXIct2pBzSHSobz3HffjJHut4v9Hr4q5peAAhWZDu8MwIRCbnaqH1f rHHUj1cZ57JATMtB+SPbawvHNO8Qklax77Z16Tqx/ed6JvsNKy97AeLOPAstMh1M9mhr ILoYl1sYp3jh2WSHZzSmrlTUuuRX/rVQNgIcOp9Fhqv/bRsCMAVH6/dT86JJB0sqCnCu oaog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vGVJH5OA7KjJlmiPWzK9scUAv0CcOHtZiCcKY3maS0o=; b=yy0ZGJC8F/IPGfVKNqCdGzR4A4I61DKlsa/YLCsF1I2TvAVhtrn7C98LJe2r6xNG18 N5YlecoNGj15smZXBjJo9K18k4FoMrOU5C+x7AluqyOH49LdmcWTwxVCIkMnRiZmkr/R oAsffzeaMjaVJ4UTKAj5T1CkOXvPtK+EZUV+VR2aPNe7rVoQ1n2ZDUM5isC5+td1Zs5a oBRTrbfH9Dlo8EJEha7Cq+kahvNKwYmg+gEv5DrovtU/R6TFQJbSFc2VizhOWFeoKTeY YZCmAH6mBEVzZ8baZetaYix0KzRAYeuT/0nroQvymIIDf/1wJfQ+xAjM7UTzF3/DfXIi J5pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AmsIsGuu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t33-20020a632261000000b0042f6352ba2csi10130019pgm.745.2022.09.05.03.05.35; Mon, 05 Sep 2022 03:05:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AmsIsGuu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236415AbiIEJre (ORCPT + 99 others); Mon, 5 Sep 2022 05:47:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236776AbiIEJr2 (ORCPT ); Mon, 5 Sep 2022 05:47:28 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 515B652DDE for ; Mon, 5 Sep 2022 02:47:21 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id w19so8642347ljj.7 for ; Mon, 05 Sep 2022 02:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=vGVJH5OA7KjJlmiPWzK9scUAv0CcOHtZiCcKY3maS0o=; b=AmsIsGuuDJ2PBKP65euT43bUkExLvC4oRSQj3LyixfKfTLB/MWq8YHdHoYouDwl5Q4 j52ymo4jSKQQc0/E8fFgmISNqRiU0uPi1XwbDKHJ4G/YjOqICxOYwISDBefatmG24pgh kMBMneQhZi2DcfPncacOycMLzlcMsGw8cncOBdI/X3zqPypKNU7lSp3dHxQ7or7CF6xy SuOGX4OBVYDhJYUScTNI/dVf7DE2JPHmpM2ogBSsOQulP3JEZA/JqpVRm267O5CkfO6A mVHerWTCMhcvcyMdQLdHprK7wr795tWvuxOPyCN3WWipXYkx+09ApxuM0TjzERSfjKSS 13gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=vGVJH5OA7KjJlmiPWzK9scUAv0CcOHtZiCcKY3maS0o=; b=N+PGF8MQFQ5pU1szAxyRTGWoFe/eZ7Gzqby6HfuSl3eVYsvsleK9GLnyq2G1DVDKSr w0RcmUr7UhBsj2RoEJblbiSbU7Qo3HHCe947rxQSfnjKlvUpr9jplxrZIyPHBGTyWeAp FQYdobb6g+zYwgx+b4SU4nwO+XmQpf/vsIu4bN8+9yUblIN0MGQrPBxCb3Im1Ju75U4O VAC3qj+J3bDw8UqJC4ovsR1ttEm2zKEBixdJq2sdT5dkPLIlBcnMtDVk5bMBYKksz6Cs RgCf1iUWyXr5MAcgYhOBti4tQfIYrpsBHfbUlJLUiIVuP+F5rGBsF+27URZoQ5K3RM53 XaKA== X-Gm-Message-State: ACgBeo3p5xbpsFsQLQoVlPRfPOrZGys/J9ax0SLxZJDCxkGXUFoCKcMa N+3eFSboVZpJCYBETccbBUf1/Vc+FNSq+aohhYviJQ== X-Received: by 2002:a05:651c:332:b0:267:649d:1f29 with SMTP id b18-20020a05651c033200b00267649d1f29mr7586946ljp.465.1662371239208; Mon, 05 Sep 2022 02:47:19 -0700 (PDT) MIME-Version: 1.0 References: <000000000000117c7505e7927cb4@google.com> <20220901162459.431c49b3925e99ddb448e1b3@linux-foundation.org> In-Reply-To: <20220901162459.431c49b3925e99ddb448e1b3@linux-foundation.org> From: Dmitry Vyukov Date: Mon, 5 Sep 2022 11:47:07 +0200 Message-ID: Subject: Re: [syzbot] UBSAN: array-index-out-of-bounds in truncate_inode_pages_range To: Andrew Morton Cc: syzbot , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, willy@infradead.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2 Sept 2022 at 01:25, Andrew Morton wrote: > > On Wed, 31 Aug 2022 17:13:36 -0700 syzbot wrote: > > > Hello, > > > > syzbot found the following issue on: > > > > HEAD commit: 89b749d8552d Merge tag 'fbdev-for-6.0-rc3' of git://git.ke.. > > git tree: upstream > > console output: https://syzkaller.appspot.com/x/log.txt?x=14b9661b080000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=911efaff115942bb > > dashboard link: https://syzkaller.appspot.com/bug?extid=5867885efe39089b339b > > compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 > > userspace arch: i386 > > > > Unfortunately, I don't have any reproducer for this issue yet. > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > Reported-by: syzbot+5867885efe39089b339b@syzkaller.appspotmail.com > > > > ntfs3: loop0: Different NTFS' sector size (1024) and media sector size (512) > > ntfs3: loop0: RAW NTFS volume: Filesystem size 0.00 Gb > volume size 0.00 Gb. Mount in read-only > > ================================================================================ > > UBSAN: array-index-out-of-bounds in mm/truncate.c:366:18 > > index 254 is out of range for type 'long unsigned int [15]' > > That's > > index = indices[folio_batch_count(&fbatch) - 1] + 1; > > I looked. I see no way in which fbatch.nr got a value of 255. > > > I must say, the the code looks rather hacky. Isn't there a more > type-friendly way of doing this? I don't see how this can happen either. Also can't reproduce. It's happened only once so far, so maybe some silent memory corruption. Let's wait for more crashes/reproducer, or otherwise syzbot will auto-close it after some time.