Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2095199rwb; Sun, 2 Oct 2022 15:09:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+BoRX59ePL8oGCxbnuM/4jsEiZH/MlsNxFfE6fdoRqte4QObQjpewhLaI7KIwjyM6Tyf3 X-Received: by 2002:a05:6a00:8d0:b0:53b:2cbd:fab6 with SMTP id s16-20020a056a0008d000b0053b2cbdfab6mr19581055pfu.3.1664748588669; Sun, 02 Oct 2022 15:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664748588; cv=none; d=google.com; s=arc-20160816; b=EJPYVlBxsXtAsIxlx3KB5pz6CVrbWaHvBMGqp63OXvbEgiNZYSwu2GN5Xy7LVmeEMi vxxHZ7ICC2RFMIyrI2mZs69LeQO69AVSgq0NN32HkGsr3A61R6tAGj0/wufQ+Z15l4Qa jKJUBH3bu+IOTeFfqwdex3wWjaODI17oAnOO0J5Pnb3hMSBWeT+4iMm/Y13a27MQuY1v xy4T0nrP6XsGnylsGPSikvWuNm7n9MGrYIaSzHJXSf6ZgECcmPBxBfnF4T6lz7AZPu2L 8RrwqFm5wcDRimMlvh1y4Dzrj9akjN9uUwlFUFilrJ0lRo/wnOlzHrf0lwZU59EvVd3v +BqA== 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=uCRA476ZAmoARGY528Dr8G2lwbqlxMrHrdrYd8As2cY=; b=OZMAtj+0bOlwA1v7b5s8ZwcTeLWAoLITPP6uPqCXEtgfTEKFiqxBUikkAsWoZpsQ4d znOvUG5GSp1393Tg4ExwnDmudIBojrbbKokWJKfhg63ZfzeVexTubxn9xrodLGpJybsv t/an9mVMIyMke/JgJ/+BYlofNfnfwqSP+n0sImp6A1g88RE3NBi5RZR9VSaWJEhMr6lt W6narXkaBgqg97rZK/oX7DuMNHZcn55UVri8bGmyHrbo4rWjCh+DeW449TDQje8pjWKX tJuIFutz1zVYIz5TYqHHwqhvrE1TT/iyK9xek6nb/5itz7hgoOTs19AzJ1CxAWMyqYFg 2Wiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Vu8AMmr1; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f21-20020a63de15000000b00430b00f507dsi5818892pgg.430.2022.10.02.15.09.37; Sun, 02 Oct 2022 15:09:48 -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=@gmail.com header.s=20210112 header.b=Vu8AMmr1; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229574AbiJBVxG (ORCPT + 99 others); Sun, 2 Oct 2022 17:53:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbiJBVxE (ORCPT ); Sun, 2 Oct 2022 17:53:04 -0400 Received: from mail-oa1-x2f.google.com (mail-oa1-x2f.google.com [IPv6:2001:4860:4864:20::2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B076A360AF for ; Sun, 2 Oct 2022 14:53:03 -0700 (PDT) Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-131ea99262dso8866338fac.9 for ; Sun, 02 Oct 2022 14:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=uCRA476ZAmoARGY528Dr8G2lwbqlxMrHrdrYd8As2cY=; b=Vu8AMmr1rXWDuTzUFCxWM4PFvHSj7lqRHf3bdDHtGLs3oB1efx+kq+eZCQuUwmclP3 4jUEhDv6NQ5zCSpozuwKHt+tbEwUJWjgZy+zoIWk+FrYEQS7tW0fbpAqEEf/uIs/nbnS FytV8O0ZL4Ji7bp1rpzXz7p1JU+DI2guvhxWhuBM86QCeN4cyZFF9QtgeTCBanpXAwDR FzvqemuiJ1I+ZiYnFUfOLi3VI31bPglQE4BQ5Sr5r1OwL6Albr5YyTGfYQFf52Iqfw17 g42eLFpM0MiSF01Qdd44kxh57F9fgQoBGJm+7AfmQo0grqYe2UzGAHmyMiQppv9lVkWh LD0w== 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=uCRA476ZAmoARGY528Dr8G2lwbqlxMrHrdrYd8As2cY=; b=E+6LeGuW65RUhiozB1smP06x2Yjbty5jt614d1kpyJ6Xe8LjXp2cpvVkhrNo5NAiUe VIE6hPo2TBnzmnoWpS0nxh/oOfKamaDQU/ECQ8QdjSAbtT6RE+dKPAt8i6A0OfUV0HNO WgmxFGQCuqmbKH3H2SwKCuxtGf5ypVzGg7bgJTJn5g2oIf/azTRKMrlFMzv49sMJP3Aa 3Z1eKbEmtNc/+8x7lhBpGs3+cHfSP/44ZpUz18pCrParpU+JO3l4L4aDSTB9Rt2NStgX LOBTjUyuiho8N/YSu8HvRpMJ4/7J/DsHzXoqql9bKzMMyltr0mlmkiGLfS+48jo+fSbf F9/g== X-Gm-Message-State: ACrzQf2s7Pp1tw7+//zticGCtar0U4YDZQmg6aDorenJHodOZ7BlER56 vGuIiQnoD3pEgLJ8A+GJW21X7XVJ9hbVhUNAI93XrjayDqU= X-Received: by 2002:a05:6870:d147:b0:126:d4a4:e99d with SMTP id f7-20020a056870d14700b00126d4a4e99dmr3698892oac.149.1664747582994; Sun, 02 Oct 2022 14:53:02 -0700 (PDT) MIME-Version: 1.0 References: <000000000000c2333105e9cc7b1c@google.com> <0000000000001f464d05ea07e1ec@google.com> In-Reply-To: <0000000000001f464d05ea07e1ec@google.com> From: Kari Argillander Date: Mon, 3 Oct 2022 00:52:43 +0300 Message-ID: Subject: Re: [syzbot] WARNING in wnd_init To: syzbot Cc: almaz.alexandrovich@paragon-software.com, linux-kernel@vger.kernel.org, ntfs3@lists.linux.dev, pjwatson999@gmail.com, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 2.10.2022 syzbot (syzbot+fa4648a5446460b7b963@syzkaller.appspotmail.com) wrote: > > syzbot has bisected this issue to: > > commit fa3cacf544636b2dc48cfb2f277a2071f14d66a2 > Author: Kari Argillander > Date: Thu Aug 26 08:56:29 2021 +0000 > > fs/ntfs3: Use kernel ALIGN macros over driver specific > > bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11e776f4880000 > start commit: 49c13ed0316d Merge tag 'soc-fixes-6.0-rc7' of git://git.ke.. > git tree: upstream > final oops: https://syzkaller.appspot.com/x/report.txt?x=13e776f4880000 > console output: https://syzkaller.appspot.com/x/log.txt?x=15e776f4880000 > kernel config: https://syzkaller.appspot.com/x/.config?x=ba0d23aa7e1ffaf5 > dashboard link: https://syzkaller.appspot.com/bug?extid=fa4648a5446460b7b963 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11cad4e0880000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1303781f080000 > > Reported-by: syzbot+fa4648a5446460b7b963@syzkaller.appspotmail.com > Fixes: fa3cacf54463 ("fs/ntfs3: Use kernel ALIGN macros over driver specific") > > For information about bisection process see: https://goo.gl/tpsmEJ#bisection I check what my patch actually changed. In my original patch I did diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index b5da2f06f7cbd..d4dd19b822bc2 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -900,7 +900,7 @@ static inline bool run_is_empty(struct runs_tree *run) /* NTFS uses quad aligned bitmaps */ static inline size_t bitmap_size(size_t bits) { - return QuadAlign((bits + 7) >> 3); + return ALIGN((bits + 7) >> 3, 8); } QuadAlign was "buggy" so that it did always give a 32 bit result back. ALIGN macro will give a 64 bit. So bitmap_size now gives different result. To me it looks like my patch actually fix this behavior. I just didn't notice this behavior when I did the patch. I have tested that if bitmap_size return u32 syzbot will not trigger the issue anymore. You can see my test patch in the Syzbot dashboard [1]. That is not prober fix imo, but just wanted to help anyone looking at this problem. [1]: https://syzkaller.appspot.com/bug?extid=fa4648a5446460b7b963