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=-3.8 required=3.0 tests=BAYES_00, 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 ACBB3C433E0 for ; Sun, 10 Jan 2021 17:14:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2C4BB224B8 for ; Sun, 10 Jan 2021 17:14:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C4BB224B8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 462B86B00C9; Sun, 10 Jan 2021 12:14:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4111C6B0289; Sun, 10 Jan 2021 12:14:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D7D46B02BD; Sun, 10 Jan 2021 12:14:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0034.hostedemail.com [216.40.44.34]) by kanga.kvack.org (Postfix) with ESMTP id 198E26B00C9 for ; Sun, 10 Jan 2021 12:14:48 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D6A3C8248068 for ; Sun, 10 Jan 2021 17:14:47 +0000 (UTC) X-FDA: 77690515014.02.route70_3110f4e27505 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id B8BAF10097AA0 for ; Sun, 10 Jan 2021 17:14:47 +0000 (UTC) X-HE-Tag: route70_3110f4e27505 X-Filterd-Recvd-Size: 2248 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Sun, 10 Jan 2021 17:14:46 +0000 (UTC) IronPort-SDR: A19LV/85AenrBgeanLDVGT5A/highVizSKmqCR5BHHwiQrIZ+I7KOVBsvpx/G3ixh/D8v5m2uA X+h5w1j8iuDA== X-IronPort-AV: E=McAfee;i="6000,8403,9860"; a="165455600" X-IronPort-AV: E=Sophos;i="5.79,336,1602572400"; d="scan'208";a="165455600" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2021 09:14:44 -0800 IronPort-SDR: Vog1mt6Z4Cdv/XDvprHlf+yzui3rRnu0gvMuFiSyqVuHjx+8KP3/21TgU/TQ7oPoR1S1ETaSO0 E0nhVTVtMfAw== X-IronPort-AV: E=Sophos;i="5.79,336,1602572400"; d="scan'208";a="351359207" Received: from tassilo.jf.intel.com ([10.54.74.11]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2021 09:14:44 -0800 Date: Sun, 10 Jan 2021 09:14:43 -0800 From: Andi Kleen To: Miaohe Lin Cc: akpm@linux-foundation.org, tglx@linutronix.de, dave.hansen@intel.com, jpoimboe@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: Fix potential pte_unmap_unlock pte error Message-ID: <20210110171443.GC1914459@tassilo.jf.intel.com> References: <20210109080118.20885-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210109080118.20885-1-linmiaohe@huawei.com> 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 Sat, Jan 09, 2021 at 03:01:18AM -0500, Miaohe Lin wrote: > Since commit 42e4089c7890 ("x86/speculation/l1tf: Disallow non privileged > high MMIO PROT_NONE mappings"), when the first pfn modify is not allowed, > we would break the loop with pte unchanged. Then the wrong pte - 1 would > be passed to pte_unmap_unlock. Thanks. While the fix is correct, I'm not sure if it actually is a real bug. Is there any architecture that would do something else than unlocking the underlying page? If it's just the underlying page then it should be always the same page, so no bug. That said of course the change is the right thing for main line, but probably doesn't need to be backported. -Andi