Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2179281pxb; Thu, 11 Feb 2021 06:25:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEA8CVn5ZyJgzHmfE97b4iJqVBw7CzcSFSI6Cn+fqpgkwalqsChRK6UDrmAvE06pbB2X3i X-Received: by 2002:a05:6402:5112:: with SMTP id m18mr8668027edd.129.1613053541796; Thu, 11 Feb 2021 06:25:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613053541; cv=none; d=google.com; s=arc-20160816; b=FJs4bycCVuFDu8373O+mjVJlfXpz+scuWR8Fa0hBRW8+yLoKAGn2yU+U5xTuRg8mCC WPdU7kNeROz2jCdB5DMy35lumMVvTn31g3BlXy+R+XSJn2tBxDCoHdooLu6of9835BFH DKTMT4T0/Js6seUryulaZrTzAVtnXnW7baCfVgy5M26xjBANOu7QDJIt8DP0siW/sCq8 dpdZsZQ3CuW8yO8QpBr+LowF+c8CzzJ4veRUBjC2xrjDVp6FQ/2dmT7zLf5dN+GK+voH wweTpOqdTNm9hnxe8KnJfyvrD1CmPBDCtt9UG5BU5h9jCwBXbDgZD9urjnJCR1MrlI6W PYAQ== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=5Xww8RvxYre9GaHVK6ekS1+0MLJh705ok+8LcldaB5o=; b=O0Q7YMMcjFPt6f9pIwC3lz1vCISwBltKOLVu33YQVX/OpS6u4ie0PnGK4fbZt1KCBq IfIZKO7mG9xJUuWqo1fzwjlKfNpZVHyk7bDTvh701eve5VH3pq7Ocg5Ui/tFMBCR554A Xs0W/CRqBeA/Ews+MN0SYltEIJ36v2hiaCBg4FqP8hdbwD7wI8hmn8HooA1EpUXQWMFC /IsFBaYGMYsOM7TvTRje8kbA/mYkVuBaWCXjVdidkl7txNjeobEAERYvAD8ENwWyT3lR vAi71nbDlM7DszXZTOZgG0np0dq3tujotQaeh1ja2r46RpCFzAFy/3H/EfazML2t4aSi ze0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=rN3S05xS; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q13si3807080eju.38.2021.02.11.06.25.17; Thu, 11 Feb 2021 06:25:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=rN3S05xS; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231802AbhBKOXi (ORCPT + 99 others); Thu, 11 Feb 2021 09:23:38 -0500 Received: from mx2.suse.de ([195.135.220.15]:50644 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231881AbhBKOVc (ORCPT ); Thu, 11 Feb 2021 09:21:32 -0500 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=1613053242; 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=5Xww8RvxYre9GaHVK6ekS1+0MLJh705ok+8LcldaB5o=; b=rN3S05xS7YtU3Rg6UqPw5SlbZI+AWmIcVh0JmVKvkqLZzI0YyLVfvB8sPv0Og+8cHxG+uD 1qAMd5eWkjWoC28ltY2cnhyCAiAnroZ163yR2yjOUhSefP/UfSBq05sgTOk3z73ngUp7DA oRtsrVbP+NW+rdCm0yGZvFkbmlDsEvw= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 306AEB007; Thu, 11 Feb 2021 14:20:42 +0000 (UTC) Date: Thu, 11 Feb 2021 15:20:41 +0100 From: Michal Hocko To: Matthew Wilcox Cc: 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: <000000000000563a0205bafb7970@google.com> <20210211104947.GL19070@quack2.suse.cz> <20210211121020.GO19070@quack2.suse.cz> <20210211125717.GH308988@casper.infradead.org> <20210211132533.GI308988@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210211132533.GI308988@casper.infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu 11-02-21 13:25:33, Matthew Wilcox wrote: > On Thu, Feb 11, 2021 at 02:07:03PM +0100, Michal Hocko wrote: > > On Thu 11-02-21 12:57:17, Matthew Wilcox wrote: > > > > current->flags should be always manipulated from the user context. But > > > > who knows maybe there is a bug and some interrupt handler is calling it. > > > > This should be easy to catch no? > > > > > > Why would it matter if it were? > > > > I was thinking about a clobbered state because updates to ->flags are > > not atomic because this shouldn't ever be updated concurrently. So maybe > > a racing interrupt could corrupt the flags state? > > I don't think that's possible. Same-CPU races between interrupt and > process context are simpler because the CPU always observes its own writes > in order and the interrupt handler completes "between" two instructions. I have to confess I haven't really thought the scenario through. My idea was to simply add a simple check for an irq context into ->flags setting routine because this should never be done in the first place. Not only for scope gfp flags but any other PF_ flags IIRC. -- Michal Hocko SUSE Labs