Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7852624rwb; Tue, 6 Dec 2022 10:37:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf4A5lRgRU/eApctPfnzMyFhyzX+RSH+9LicSduHa1Wl8PPgmL+NajclV0IsJasp3Rn+SRCm X-Received: by 2002:a17:906:38f:b0:7c1:31d:8b75 with SMTP id b15-20020a170906038f00b007c1031d8b75mr5586079eja.157.1670351844336; Tue, 06 Dec 2022 10:37:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670351844; cv=none; d=google.com; s=arc-20160816; b=iei1/cyV8iHED62HE8oMbCeCtA1RfdWYcnc47zCJqKio09QTg8I9bz3/an7SHuFgZy Rz0eye6XcGIbfiiUNiSbbO0N3zR22n1R7IY7qwuJhansd7lCjkxB4d9ARy1NNnKCiN35 9zqw2fCGhlewUfB5A+mTJ0ArTBr6Pxhu9eWDXpN54HoWGPNBtELPEK5QsDrSC7Z1edvb kVDIgO8/pDXTZd+YDf3HGO18bvMfp7VrQ+YzcZYmJcjjK6Mn7yXEtaK66TVZ7F3iPo2n cvuJHincbezGgaTgjhkpwWsvNueD7nNLxrcm0TNTTCITlnlHLt2XBrEpEMlUS7NDc49W BU6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=N78cOrbKUw2dEVBG4pJoeLv5zRk7aEtt8Ts+89zdIrw=; b=YHbU3yAAW9dMmaTiul3YkDMqP5pRo8e5+uE/kInLoa+MI/Q3PRS6jCFIDstwM/8aRs 7htRpuMT2lYeZJHPb+jSZ8iusZXTyHgEkiVYLJJ1KftrQ/kymK+UKgLDTJzm5wSOa9HR FVbm8kAihjmiFn2Vme0Aqx+yqmLE0i7N90WF6pK3M/6lB6+pWZ7HIEJV7N2GzdifJ1Nm XW2qH8ktvxCmWaSRaKGlTEbDvMpKBKMkxUxVyQvpoqdZKtnISodgc5K5H7pW2P4Y7j/n 1DFH3hdhbTFdNLnZFT0TP8rdsnw62hZPtZr4hsrrawUwaqNn6oBt8AUTmXLHDBnt4Cug ZUwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dLGwzyu6; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb1-20020a1709076d8100b007bc23eb6ca6si3823131ejc.811.2022.12.06.10.37.05; Tue, 06 Dec 2022 10:37:24 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=dLGwzyu6; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229541AbiLFRrh (ORCPT + 77 others); Tue, 6 Dec 2022 12:47:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbiLFRrf (ORCPT ); Tue, 6 Dec 2022 12:47:35 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D01536C7B; Tue, 6 Dec 2022 09:47:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D5970B81AF7; Tue, 6 Dec 2022 17:47:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F988C433C1; Tue, 6 Dec 2022 17:47:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670348849; bh=kpThiEp3UAhW6pzLUVd7+M75zxZbydrFxRCxs6or0pE=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=dLGwzyu6XmzXG/L7DgvYNGWvQ9CokgYuQ3e5dBAMRWxe613GDVfj+rDE5SGfYm1R/ nKrJvuleNLFbCmMF++/f7pPQ+pxAZJxxC/4xK4fWmxN0PAj6GMwxWUtbso3V0Rj04i AJ7pU9+Gdq8Bvsn4G2ftpVQZs9PoSoDXW5gKdVKpVHNfkY4vratV2NcktXcmn3zl6N I0KzBVamo3uo0TxBnJ30iJea5++v8gNwkTIyZDKVQJUa6WnF81ykjlGxHimNvc0QoU AA6CpGPHcDrDiod2YFpGRvS6WAWgUuV5RCJHem3z5PSFLn0+aAIzUznBSZ+KFNRPiM Zxv/88KAO8S8A== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 2D3EA5C0952; Tue, 6 Dec 2022 09:47:29 -0800 (PST) Date: Tue, 6 Dec 2022 09:47:29 -0800 From: "Paul E. McKenney" To: Dmitry Vyukov Cc: Dave Chinner , frederic@kernel.org, quic_neeraju@quicinc.com, Josh Triplett , RCU , syzbot , djwong@kernel.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, syzkaller-bugs@googlegroups.com, syzkaller Subject: Re: [syzbot] KASAN: use-after-free Read in xfs_qm_dqfree_one Message-ID: <20221206174729.GQ4001@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <000000000000bd587705ef202b08@google.com> <20221206033450.GS3600936@dread.disaster.area> <20221206153211.GN4001@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Tue, Dec 06, 2022 at 05:19:10PM +0100, Dmitry Vyukov wrote: > On Tue, 6 Dec 2022 at 16:32, Paul E. McKenney wrote: > > > > On Tue, Dec 06, 2022 at 12:06:10PM +0100, Dmitry Vyukov wrote: > > > On Tue, 6 Dec 2022 at 04:34, Dave Chinner wrote: > > > > > > > > On Mon, Dec 05, 2022 at 07:12:15PM -0800, syzbot wrote: > > > > > Hello, > > > > > > > > > > syzbot has tested the proposed patch but the reproducer is still triggering an issue: > > > > > INFO: rcu detected stall in corrupted > > > > > > > > > > rcu: INFO: rcu_preempt detected expedited stalls on CPUs/tasks: { P4122 } 2641 jiffies s: 2877 root: 0x0/T > > > > > rcu: blocking rcu_node structures (internal RCU debug): > > > > > > > > I'm pretty sure this has nothing to do with the reproducer - the > > > > console log here: > > > > > > > > > Tested on: > > > > > > > > > > commit: bce93322 proc: proc_skip_spaces() shouldn't think it i.. > > > > > git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > > > > > console output: https://syzkaller.appspot.com/x/log.txt?x=1566216b880000 > > > > > > > > indicates that syzbot is screwing around with bluetooth, HCI, > > > > netdevsim, bridging, bonding, etc. > > > > > > > > There's no evidence that it actually ran the reproducer for the bug > > > > reported in this thread - there's no record of a single XFS > > > > filesystem being mounted in the log.... > > > > > > > > It look slike someone else also tried a private patch to fix this > > > > problem (which was obviously broken) and it failed with exactly the > > > > same RCU warnings. That was run from the same commit id as the > > > > original reproducer, so this looks like either syzbot is broken or > > > > there's some other completely unrelated problem that syzbot is > > > > tripping over here. > > > > > > > > Over to the syzbot people to debug the syzbot failure.... > > > > > > Hi Dave, > > > > > > It's not uncommon for a single program to trigger multiple bugs. > > > That's what happens here. The rcu stall issue is reproducible with > > > this test program. > > > In such cases you can either submit more test requests, or test manually. > > > > > > I think there is an RCU expedited stall detection. > > > For some reason CONFIG_RCU_EXP_CPU_STALL_TIMEOUT is limited to 21 > > > seconds, and that's not enough for reliable flake-free stress testing. > > > We bump other timeouts to 100+ seconds. > > > +RCU maintainers, do you mind removing the overly restrictive limit on > > > CONFIG_RCU_EXP_CPU_STALL_TIMEOUT? > > > Or you think there is something to fix in the kernel to not stall? I > > > see the test writes to > > > /proc/sys/vm/drop_caches, maybe there is some issue in that code. > > > > Like this? > > > > If so, I don't see why not. And in that case, may I please have > > your Tested-by or similar? > > I've tried with this patch and RCU_EXP_CPU_STALL_TIMEOUT=80000. > Running the test program I got some kernel BUG in XFS and no RCU > errors/warnings. > > Tested-by: Dmitry Vyukov Applied, thank you both! I expect to push this into the v6.3 merge window, that is, not the one coming up real soon now, but the one after that. Thanx, Paul > Thanks > > > At the same time, I am sure that there are things in the kernel that > > should be adjusted to avoid stalls, but I recognize that different > > developers in different situations will have different issues that they > > choose to focus on. ;-) > > > > Thanx, Paul > > > > ------------------------------------------------------------------------ > > > > diff --git a/kernel/rcu/Kconfig.debug b/kernel/rcu/Kconfig.debug > > index 49da904df6aa6..2984de629f749 100644 > > --- a/kernel/rcu/Kconfig.debug > > +++ b/kernel/rcu/Kconfig.debug > > @@ -82,7 +82,7 @@ config RCU_CPU_STALL_TIMEOUT > > config RCU_EXP_CPU_STALL_TIMEOUT > > int "Expedited RCU CPU stall timeout in milliseconds" > > depends on RCU_STALL_COMMON > > - range 0 21000 > > + range 0 300000 > > default 0 > > help > > If a given expedited RCU grace period extends more than the