Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2721304pxb; Sun, 24 Jan 2021 18:18:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJx48gPAe/lIulhlGmM5q1iuyNaAi5NUUAANY8bnkkPMTIBXsOOHglYLAxeThlpfX+Uhk7KF X-Received: by 2002:a05:6402:22ba:: with SMTP id cx26mr136623edb.350.1611541129166; Sun, 24 Jan 2021 18:18:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611541129; cv=none; d=google.com; s=arc-20160816; b=gnU/1VyO1MW51+A5m6152dhU39SPeNzPVQKPT8mgr5kUre7KjAK/+rUQbY6cvziOue pTWUyIS+esFa7vHVR7FmIq9hZbuiYKLm/4YP6vM79dfcLpnrygxk9E/6NmBvGQi8Wn/X c1vvWv/2WBsaZeC5O2euHNfIHg2rWTTWuxk2lKrnAw3MyGQls3vp/frC3Qlu4Y4QYaPp 80J/0sT+JdiLO1xkEY5hLNuJCVP84qJphNvn4FjKPN3n+fZ0YwL18WySxrFEoOD6w+Cl t8nmtMihLlNZ3aoQPh21Mv+EpHqFM5S9GbMzjVv92L7zx1QrBnSiHzVq1n3Q4VvJ3H+M qyLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=jAAFFq346qoSbtlLNcg4T3ylSgwKR2VNqH4mZmiRHuU=; b=dw5t5VUB0jqOSP5ziOPjfpCauprr6hJhc0SrC5tUMBK3nZL00vO0/A8d05x22zlsfd LHfxrn86nhnPoJrT+SIdaAEq47auPIvRWih2X+VioEHA5Rqu5VEr0tPC0v6fEQ1OE7aa HYzj0LgIrCBVHKiIf2s7lonxdIt4S7o1b+A8OY2aD27U4qTRcE57Gdtnle4kwc/lbpNx 6Gp7YmuUr54hWlAPSr7FZG7huWa5pPnAnufsHPYr2/WYl8mFTFgNcxvNOpE1lSssZNO9 XN6DkNrLZHstjPxVrOQRGAsdwrlZ/M/FZeRa53BuEBGyaweYLoxMkFR+xsOOKoKkCg2p 9egw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si2737288edd.262.2021.01.24.18.18.23; Sun, 24 Jan 2021 18:18:49 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726951AbhAYCOe (ORCPT + 99 others); Sun, 24 Jan 2021 21:14:34 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:11434 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727065AbhAYCFQ (ORCPT ); Sun, 24 Jan 2021 21:05:16 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DPCny1TLTzjBgB; Mon, 25 Jan 2021 10:03:34 +0800 (CST) Received: from [10.174.179.117] (10.174.179.117) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Mon, 25 Jan 2021 10:04:20 +0800 Subject: Re: [PATCH] mm: Fix potential pte_unmap_unlock pte error To: Andrew Morton CC: , , , , , Andi Kleen References: <20210109080118.20885-1-linmiaohe@huawei.com> <20210110171443.GC1914459@tassilo.jf.intel.com> <530deddf-705e-045d-f7c6-521531dced71@huawei.com> <2c691a87-42fd-63f6-6d7a-136be6572fab@huawei.com> <20210123180107.95f54cc0849a6d8c6afa16ee@linux-foundation.org> From: Miaohe Lin Message-ID: <372dc830-56ae-799c-6026-bb35c1803026@huawei.com> Date: Mon, 25 Jan 2021 10:04:19 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210123180107.95f54cc0849a6d8c6afa16ee@linux-foundation.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.117] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi: On 2021/1/24 10:01, Andrew Morton wrote: > On Fri, 22 Jan 2021 16:27:23 +0800 Miaohe Lin wrote: > >> Hi Andrew: >> On 2021/1/14 10:51, Miaohe Lin wrote: >>> Hi: >>> On 2021/1/11 1:14, Andi Kleen wrote: >>>> 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. >>>> >>> >>> It's just a theoretical issue via code inspection. >> >> Should I send a new one without Cc statle or just drop this patch? Thanks. > > Your patch makes the code much less scary looking. I added Andi's > observation to the changelog, removed the cc:stable and queued it up, > thanks. > > . > Sounds reasonable. Many thanks for doing this!