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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 68FA7C433E0 for ; Fri, 12 Feb 2021 15:43:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 08E6164E05 for ; Fri, 12 Feb 2021 15:43:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08E6164E05 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8A9F58D0067; Fri, 12 Feb 2021 10:43:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 857E18D0060; Fri, 12 Feb 2021 10:43:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7470F8D0067; Fri, 12 Feb 2021 10:43:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id 5BCB28D0060 for ; Fri, 12 Feb 2021 10:43:31 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1450A181AF5C7 for ; Fri, 12 Feb 2021 15:43:31 +0000 (UTC) X-FDA: 77810035422.27.EAE8196 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf27.hostedemail.com (Postfix) with ESMTP id 4A6D780192C0 for ; Fri, 12 Feb 2021 15:43:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1613144609; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=l0Bxq/KL0yCkvILl5jK3tOzdE/S+BbmACGvGuXjiKlQ=; b=ZD0+PegvL1j/B9IAapTxvSrPEq+miH/2OP7sAg7hCOzO9dQPnAGORUPAWwnC4ACmTzXN2u 1DpJ2B69//yyWooIjxZHp+g0FeoOA9EbzZiWeEJEA6kmdNdpcggWU2uX4aeuLDujdT5niu wf9vNQeGrI8PlmtNST4D1BxYGAJwyS4= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 52196AD29; Fri, 12 Feb 2021 15:43:29 +0000 (UTC) Date: Fri, 12 Feb 2021 16:43:28 +0100 From: Michal Hocko To: Tetsuo Handa Cc: Matthew Wilcox , Jan Kara , Dmitry Vyukov , syzbot , Jan Kara , linux-ext4@vger.kernel.org, LKML , syzkaller-bugs , Theodore Ts'o , Linux-MM Subject: Re: possible deadlock in start_this_handle (2) Message-ID: References: <20210211125717.GH308988@casper.infradead.org> <20210211132533.GI308988@casper.infradead.org> <20210211142630.GK308988@casper.infradead.org> <9cff0fbf-b6e7-1166-e4ba-d4573aef0c82@i-love.sakura.ne.jp> <20210212122207.GM308988@casper.infradead.org> <2b90c488-a6b9-2565-bd3a-e4f8bf8404e9@i-love.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2b90c488-a6b9-2565-bd3a-e4f8bf8404e9@i-love.sakura.ne.jp> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 4A6D780192C0 X-Stat-Signature: a5dewbwhsy7zdf1nz4n54sbib13eqfzq Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf27; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613144609-716049 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: On Fri 12-02-21 21:58:15, Tetsuo Handa wrote: > On 2021/02/12 21:30, Michal Hocko wrote: > > On Fri 12-02-21 12:22:07, Matthew Wilcox wrote: > >> On Fri, Feb 12, 2021 at 08:18:11PM +0900, Tetsuo Handa wrote: > >>> On 2021/02/12 1:41, Michal Hocko wrote: > >>>> But I suspect we have drifted away from the original issue. I thought > >>>> that a simple check would help us narrow down this particular case and > >>>> somebody messing up from the IRQ context didn't sound like a completely > >>>> off. > >>>> > >>> > >>> From my experience at https://lkml.kernel.org/r/201409192053.IHJ35462.JLOMOSOFFVtQFH@I-love.SAKURA.ne.jp , > >>> I think we can replace direct PF_* manipulation with macros which do not receive "struct task_struct *" argument. > >>> Since TASK_PFA_TEST()/TASK_PFA_SET()/TASK_PFA_CLEAR() are for manipulating PFA_* flags on a remote thread, we can > >>> define similar ones for manipulating PF_* flags on current thread. Then, auditing dangerous users becomes easier. > >> > >> No, nobody is manipulating another task's GFP flags. > > > > Agreed. And nobody should be manipulating PF flags on remote tasks > > either. > > > > No. You are misunderstanding. The bug report above is an example of > manipulating PF flags on remote tasks. The bug report you are referring to is ancient. And the cpuset code doesn't touch task->flags for a long time. I haven't checked exactly but it is years since regular and atomic flags have been separated unless I misremember. > You say "nobody should", but the reality is "there indeed was". There > might be unnoticed others. The point of this proposal is to make it > possible to "find such unnoticed users who are manipulating PF flags > on remote tasks". I am really confused what you are proposing here TBH and referring to an ancient bug doesn't really help. task->flags are _explicitly_ documented to be only used for _current_. Is it possible that somebody writes a buggy code? Sure, should we build a whole infrastructure around that to catch such a broken code? I am not really sure. One bug 6 years ago doesn't sound like a good reason for that. -- Michal Hocko SUSE Labs