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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 13B11C33CB3 for ; Wed, 15 Jan 2020 00:25:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C795424671 for ; Wed, 15 Jan 2020 00:25:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="C04IgBqN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C795424671 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 65ADD8E0005; Tue, 14 Jan 2020 19:25:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 60C058E0003; Tue, 14 Jan 2020 19:25:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5223F8E0005; Tue, 14 Jan 2020 19:25:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3E1CB8E0003 for ; Tue, 14 Jan 2020 19:25:29 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id C72EE180AD811 for ; Wed, 15 Jan 2020 00:25:28 +0000 (UTC) X-FDA: 76377974736.20.wood24_871deb9dd1560 X-HE-Tag: wood24_871deb9dd1560 X-Filterd-Recvd-Size: 2928 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jan 2020 00:25:28 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7362524658; Wed, 15 Jan 2020 00:25:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579047927; bh=t47i4w95/DIUUMrwWQ8/0OpI2zfXnSX/nTKhPDQjj3I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=C04IgBqNac5Tr6TP2KFYhPKu9LtJWqxYSm3atW4PhXrvKpzVK781u9g36NgSHZeB/ by+Mas1xVtmq/5iyd5yBA8zZBK+vC86Fz9vLo4aTdUO1a83UCr18jqR9DVBTn0LxiX 5gZBfQvAwfCPjehY4gCn6jGnQKWjjtCaNrnxsdYM= Date: Tue, 14 Jan 2020 16:25:26 -0800 From: Andrew Morton To: "Aneesh Kumar K.V" Cc: peterz@infradead.org, will@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH v3 0/9] Fixup page directory freeing Message-Id: <20200114162526.87863ebce00695cc979b5217@linux-foundation.org> In-Reply-To: <20200114100145.365527-1-aneesh.kumar@linux.ibm.com> References: <20200114100145.365527-1-aneesh.kumar@linux.ibm.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Tue, 14 Jan 2020 15:31:36 +0530 "Aneesh Kumar K.V" wrote: > This is a repost of patch series from Peter with the arch specific changes except ppc64 dropped. > ppc64 changes are added here because we are redoing the patch series on top of ppc64 changes. This makes it > easy to backport these changes. Only the first 3 patches need to be backported to stable. But none of these patches had a cc:stable in the changelog? > The thing is, on anything SMP, freeing page directories should observe the > exact same order as normal page freeing: > > 1) unhook page/directory > 2) TLB invalidate > 3) free page/directory > > Without this, any concurrent page-table walk could end up with a Use-after-Free. > This is esp. trivial for anything that has software page-table walkers > (HAVE_FAST_GUP / software TLB fill) or the hardware caches partial page-walks > (ie. caches page directories). > > Even on UP this might give issues since mmu_gather is preemptible these days. > An interrupt or preempted task accessing user pages might stumble into the free > page if the hardware caches page directories. > > This patch series fixup ppc64 and add generic MMU_GATHER changes to support the conversion of other architectures. > I haven't added patches w.r.t other architecture because they are yet to be acked.