Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp1749831pxb; Sun, 10 Jan 2021 09:18:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLHxdgZLBWNqRk4bc3I/8ZeOpVNOvl0qjYA6FW+qmtlfT+cAwKgXEiO/MUS19KfGGIfszc X-Received: by 2002:a17:906:6d14:: with SMTP id m20mr8285932ejr.3.1610299139327; Sun, 10 Jan 2021 09:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610299139; cv=none; d=google.com; s=arc-20160816; b=i+8S3zRRF9wmxsxHNjCinx8mX3/QV3wOaS0v/OyqijsKvNa7FdiZ4afZk5GCzyJkgw H6RmAf6QQnjII8rmVt+Ir17NIi7WEpkGQjQ4LGFzk7lay8Ny8RPLLs8rbbTf2JWWs4HC OtWHBBNSmccfuyH18rSi6yklY+J8j8Qeda7IMa7MsRcHkshW0AEUbMuCB2cAJjXNMwGV QhoVdBPpTRQXCaKp8YXk/ww1sM5RmPb9+wZutlkz+PbaE0I8d5sWdkxu0ycYQiZtb1/E By9tS5+0vbgs0OSpp6s3jg++6mE2VOcYkyxHmP9sFl47dCk1h0EoPJgPiYi0rYNmkGad HlOg== 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:ironport-sdr :ironport-sdr; bh=TyrL7WdVgx8e6G1rgiD8aiGMyuXHfB4MjsFnRtXvN5M=; b=yzr72zKMtdnpSr6TfCV1qf5SJ1hl9TGdQp+AWqSaahI4URKblR2opjuVsRU/bOKpzi zzQ5ah5NYHcOfAMRkwG3K+Yz2dJkbsMol4ILHQ4fVxi4N5ESJU1/dLTgC+mwIzKA86El tTU4QafTAxY8+oNf37vrUrBnwwx65vC/CdQgfXNeGJm3dQiVEYPVWEjJXFX3fImyS6uM TXEjFC9Sh7GX8RuioUZdCfiYkYj6ShFsxbumxEe15uCKVhZV9eIoc/OOBkOyXSZSoHEw vUAEArV7xkT+g++PQF+qHuxCh3vANRH58/pENtgS5toi6YNGHpOmnkvWsIXDgwfrM1kr QEIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bg24si5701957ejb.121.2021.01.10.09.18.34; Sun, 10 Jan 2021 09:18:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726554AbhAJRQb (ORCPT + 99 others); Sun, 10 Jan 2021 12:16:31 -0500 Received: from mga07.intel.com ([134.134.136.100]:21408 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbhAJRQa (ORCPT ); Sun, 10 Jan 2021 12:16:30 -0500 IronPort-SDR: 2lyx9gwrdE4bWJHIQjxFECCjlIQ0zTxDeMpCmgCtiCDtyFx/8hPBj3mYvBfLmlKHBPrhXuHNFM 4kdDcw0RCJkQ== X-IronPort-AV: E=McAfee;i="6000,8403,9860"; a="241844248" X-IronPort-AV: E=Sophos;i="5.79,336,1602572400"; d="scan'208";a="241844248" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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