Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1729566ioo; Fri, 27 May 2022 15:48:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRj1cl+7CH4/AEtaWL9fVEe4RV975c1EQ2RqTwTzgIdVYrHloq/eDngWZbwmgAN+z5mVuc X-Received: by 2002:a63:f046:0:b0:3c6:a37b:1613 with SMTP id s6-20020a63f046000000b003c6a37b1613mr39401835pgj.168.1653691714912; Fri, 27 May 2022 15:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653691714; cv=none; d=google.com; s=arc-20160816; b=qTHaFgMcSz/sVNI64wvZUTYVh5TKrAc/XtP1raZ/vCVI4YJAArZqca7u5kfnBR0y2n zQUUrwjTNXUIVX669C2QDPuCk5VvMQiNd0zyLPCnQt+6At70xYOA9moE4lsSbpQnySw5 PBIP9DaW2p1iXB8ai8fhMyXZsjywVPAP9zpecJeVCDbJXxlQCQVoBUoBAAi2RSWYQ8Kr 61e9TepPshTo77/yFooL4PaectWPIAFEp6B+C92VqDpuxbH5KhIxYM9qjn/cjBtnzt+n 3jKdywVUSE0W8ohz5WFu0fPc74oyO30V539ULUZl4BttdFBZHTwAC/alD6iKNgOBl/OX I8cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OqaDyen+xHLMjM1+kU3vv7vEUmDoXnKLSHCxr0ki/yI=; b=wNW/y0z3JV1mNOsdSRP33P9Z9fYxvnik96DcgBHBnQRK/FTd15kbIPR/0fNO73G76X LfPe6fdxXfiOXoSX0cgISu3TqB6iit9G1/nAXF6j/86Av8qqDSUgltgeB5B7gyuWkN5r YAjv4Dkv1/pZwDXi9c5Q26yUmOWy0/9+KErVCXoomKWyCGcKmyZZl2KyJY9QHJGu1fbr lwv2eOdr7aZMefC1IeuKoK/N0pKGcU2JfN392Od1e+EvvNkvnvwpxDYUfimdx1OO5zOR 87Mfq+KcDohLQQrk56DpRTDm8+i6ZFa5RjR6am9SGwi+KoZTYqB9DXpQbUSZa3Cej97O taIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=BkgFlzuG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a170902f70900b00163a0f48480si2383532plo.36.2022.05.27.15.48.24; Fri, 27 May 2022 15:48:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=BkgFlzuG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232738AbiEZSby (ORCPT + 99 others); Thu, 26 May 2022 14:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233171AbiEZSbq (ORCPT ); Thu, 26 May 2022 14:31:46 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 254052714D for ; Thu, 26 May 2022 11:31:43 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id h11so2795486eda.8 for ; Thu, 26 May 2022 11:31:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OqaDyen+xHLMjM1+kU3vv7vEUmDoXnKLSHCxr0ki/yI=; b=BkgFlzuGNKyb+uNyGnU6TxJ6tLPcnTTz0fIfAd0G6SJqAnBMulcPqqFv87YZb40zBr 45DtchsOB/RWvL1ETS2WM5vNZNWwcoQi6eUXN3Y8ht6azoD9p5U3j+SjLzDTj5jRzMFr mWYp8z+Lw27JzV6nLRO784rXgmDzNNVW1X4rPhGqT9CcDL8N1xECKwkUKmAH6hwNip8o tSoFF1Gw5harFb5i08n4Q7kK2a6o3lPbBYAZ1gbMnFKFovTyzUOrKznNLujUO78M392n snBE7BSEouVeDgQ6JuN5/Yu3lgHzFryGE7lN27p/JX2G+Yeoipo1Iq2B6uT8zo0Dp3kg Y26A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OqaDyen+xHLMjM1+kU3vv7vEUmDoXnKLSHCxr0ki/yI=; b=PEnh+uxf7YKYsHPnrLMROIh8cM/kJIPTNTR3c90qT/ui6X4PKtJUb49bRbJ8q/TTY1 O1QH1x9NblGdknx6X+kv4jQhRIf75cqMEIS2xU8tvOE7Z6OVlFzz/0ii3THwOTFRGdi+ CxO4TlLK2lofObhLdu0EK9GwQVazmMzZFIbJ+W5NEJvRDJbGrhHg8qMamknhB8yCnEB5 YDXYDBbhURpkixWLcTNGBR1FS83Lwxo4rEnDAyRnDdBjtbkkYjkOqTQKlTVnvKBAOX4d k261xtz8V7DgczPOECr8Fx4NuXZjhUWIGGKLzAkN9tJC43cgBWrDRdJmH8g+DcPrcV19 EY1Q== X-Gm-Message-State: AOAM532zprev/AYBzmKi2ppc94wki+/2mXzE3SU8idI1JV6OhFqbBg3D FoRidq9IKkU9/pRUUI66dN/KgenIFC7D/4ttFMwtcA== X-Received: by 2002:aa7:dccd:0:b0:42b:d509:b5b with SMTP id w13-20020aa7dccd000000b0042bd5090b5bmr6266347edu.19.1653589902378; Thu, 26 May 2022 11:31:42 -0700 (PDT) MIME-Version: 1.0 References: <20220526113350.30806-1-linmiaohe@huawei.com> <20220526111546.50102da288cccbe913cadbf4@linux-foundation.org> In-Reply-To: <20220526111546.50102da288cccbe913cadbf4@linux-foundation.org> From: Pasha Tatashin Date: Thu, 26 May 2022 14:31:06 -0400 Message-ID: Subject: Re: [PATCH] mm/page_table_check: fix accessing unmapped ptep To: Andrew Morton Cc: Matthew Wilcox , Miaohe Lin , David Rientjes , linux-mm , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Miaohe, please store the ptep, or maybe drop this patch entirely. > > I think it's best to fix it. I rewrote the changelog as > > : ptep is unmapped too early, so ptep could theoretically be accessed while > : it's unmapped. This might become a problem if/when CONFIG_HIGHPTE becomes > : available on riscv. > : > : Fix it by deferring pte_unmap() until page table checking is done. > > I'll retain the Fixes:. This doesn't imply cc:stable in MM, and anyone > who backports the original patchset will want to know about this fixup. Makes sense. > And I queued a fixup for the thing Matthew noticed. Thank you Andrew. Pasha