From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29064C433EF for ; Tue, 21 Sep 2021 18:38:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B01C561186 for ; Tue, 21 Sep 2021 18:38:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B01C561186 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0A62E6B006C; Tue, 21 Sep 2021 14:38:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 055626B0071; Tue, 21 Sep 2021 14:38:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E8692900002; Tue, 21 Sep 2021 14:38:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id D644C6B006C for ; Tue, 21 Sep 2021 14:38:19 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8A233180A93B5 for ; Tue, 21 Sep 2021 18:38:19 +0000 (UTC) X-FDA: 78612440718.38.E84E998 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf15.hostedemail.com (Postfix) with ESMTP id 3DEA0D0000A1 for ; Tue, 21 Sep 2021 18:38:19 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 31D0D61184; Tue, 21 Sep 2021 18:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632249498; bh=GYp+GD7woP+oqzGPK1TfF9rqQCvSZn0ne1+pmq9pGTM=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=FqAnW4JiAw3P+RWsbonqAq6LBaMcmnH1rvw37IKeOnQ0HK3gGiVg4KUf66LJKQhFE Va3RmR6fzGLchtk1hAMhuWxLThxTQNo7xj4QEVjA73K8sf5dnUMTKz1DKyGa/HNNLo M7FcAZfr7C2Pfw26W4F805FHg6ZYoqptCta3zA5aJI1sDxlnxTuw/DRyIhiWQZT5xy qoCRug2/+O3pvo4uoNbOM3Dmwv+IEPEnxL+qaT7EASzIfNybbt2mfKf2UauqkNnNDS Wv+5OMAICiXvoXoL6DaM1w02ilG9AbHT86cyWsUiOawreHmrk8waFNwT17RSxBdFlE M1o3LSAxUBwbg== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <87sfy07n69.ffs@tglx> References: <000000000000423e0a05cc0ba2c4@google.com> <20210915161457.95ad5c9470efc70196d48410@linux-foundation.org> <163175937144.763609.2073508754264771910@swboyd.mtv.corp.google.com> <87sfy07n69.ffs@tglx> Subject: Re: [syzbot] WARNING in __init_work From: Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, Waiman Long , Paul E. McKenney , Al Viro , Jens Axboe , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Andrew Morton , Thomas Gleixner , syzbot Date: Tue, 21 Sep 2021 11:38:16 -0700 Message-ID: <163224949689.3714697.17466968510780664239@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 3DEA0D0000A1 Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=FqAnW4Ji; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of sboyd@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=sboyd@kernel.org X-Stat-Signature: qkrg1fczpoi3bcqn665nkqpxmu8eqj9o X-HE-Tag: 1632249499-626477 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Quoting Thomas Gleixner (2021-09-19 05:41:18) >=20 > Again, it cannot do that from a softirq because > synchronize_rcu_expedited() might sleep. >=20 > > Is it possible that object_is_on_stack() doesn't work in IRQ context? > > I'm not really following along on x86 but I could see where > > task_stack_page() gets the wrong "stack" pointer because the task has o= ne > > stack and the irq stack is some per-cpu dedicated allocation? >=20 > Even if debug objects would support objects on irq stacks, the above is > still bogus. But it does not and will not because the operations here > have to be fully synchronous: >=20 > init() -> queue() or arm() -> wait() -> destroy() >=20 > because you obviously cannot queue work or arm a timer which are on stack > and then leave the function without waiting for the operation to complete. Is there some way to make it more obvious that initializing a timer or work on the stack in an irq context is a NONO because we can't wait for it? Maybe some sort of debugobjects call to might_sleep() when it's being told the object is on the stack, or throwing a might_sleep() into the initialization of any stack based timer or workqueue, or both? >=20 > So these operations have to be synchronous which is a NONO when running > in hard or soft interrupt context because waiting for the operation to > complete is not possible there. >