Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp32377613rwd; Fri, 7 Jul 2023 12:55:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlEH7/zCagVb8w0CaHCJrPWOI+RgPbhoH0UNW2HMg3r/KsrpkeLlmeBY53osVdSH7r391vld X-Received: by 2002:a17:903:1246:b0:1b8:6cac:ffe8 with SMTP id u6-20020a170903124600b001b86cacffe8mr6409492plh.51.1688759745138; Fri, 07 Jul 2023 12:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688759745; cv=none; d=google.com; s=arc-20160816; b=BP6Lcv7qzmeoiIMiot/754d0ir+M+LtDyTNWmV9ZiOByZHSRLe87B2u5cJRYvcFNDc A2994OQ8xR9gZLhq4llxFE9U3Yd2aSYwQ3zKamNKuTui2uKLgDuHpXmvHy1ZuMOMDR++ ER9IFAHW/fevwRjXbx8e/P5WAKeJyh7ILauGJpDrbTIWRs/fUS4bxAZtSOQZtvAhduzF 8P1J1rjNGjo7N9k9Itxlm7PjRzcubDK3/S2omMfp5isaq11QRWRgvYosd7+/tnh3uylT hbfv8R6rk8msGarRkIyn4qJhgFnVcEYSDThatubKG8g9IPmKwjVIJKlDlFMCmRTs/Zjb vNng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=XlRO074YmNp5FxBUfiSV2D7fSrJrr/U1VwJoMuvgqqM=; fh=qtT3I61/e7KL7H7hjx0F7aZ9k/rZju/ONjtu0Lq4BvE=; b=UO5ZSs5ZrbckEWIKvUARTcE5oFu0E+eqpTsduvuvsPz1HeRe6eSg8YnjRnK7pA/TmC cfCrXXcFgdJx0feA4Aw0bDPaUeUmI4xnMLVPLf3ZXgjCSDvxLelbZ/pSCFGjqzFMrVOO lvoqZMxuhUqiLKItLuLbjMMEDoYWt7FKX9xeZJqm333Gk3+vVysB34c9zsQsAptIa3vy 5eP/fV40E1eACfBEiGUI0f3tUQXgd3CZNh3hLm7S+igOCwxGrrGUUq2STK768vCrGSYl wlzP7ckJgJCQeR0jW/bDN9cd0RVIurnYs+0GA60BhZ6sCxxRVUuVoCguQFG1ds/J7J7x bhOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=ysms7tEh; 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 j5-20020a170903024500b001ae4a01a7e0si4863602plh.236.2023.07.07.12.55.33; Fri, 07 Jul 2023 12:55:45 -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=@linux-foundation.org header.s=korg header.b=ysms7tEh; 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 S232366AbjGGTku (ORCPT + 99 others); Fri, 7 Jul 2023 15:40:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbjGGTis (ORCPT ); Fri, 7 Jul 2023 15:38:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C31D52102 for ; Fri, 7 Jul 2023 12:38:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 259C961A6D for ; Fri, 7 Jul 2023 19:38:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41382C433C8; Fri, 7 Jul 2023 19:38:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1688758726; bh=+YHD2FQa8AN1ojxg4gSuv37zOlSDANnbaMA0KQyroLk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ysms7tEhRWgogk1QgZ+ySVxlXKaxzlOCrOp0RTfWSdPcLzMlw0Sg8kYhjLBHUxHS+ N8khlmkYnf/8+810Uv05gvVbkxCKakJfhBcon57nhvMkVdLSgyO8D27KJhiioIqISl 3/BOy2loQy5P4pFWXBR2/DnbUHrjZBlsegqOqMtQ= Date: Fri, 7 Jul 2023 12:38:44 -0700 From: Andrew Morton To: Muchun Song Cc: mike.kravetz@oracle.com, muchun.song@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: hugetlb_vmemmap: fix a race between vmemmap pmd split Message-Id: <20230707123844.adf56ba3e0d000f6da431494@linux-foundation.org> In-Reply-To: <20230707033859.16148-1-songmuchun@bytedance.com> References: <20230707033859.16148-1-songmuchun@bytedance.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Fri, 7 Jul 2023 11:38:59 +0800 Muchun Song wrote: > The local variable @page in __split_vmemmap_huge_pmd() to obtain a pmd > page without holding page_table_lock may possiblely get the page table > page instead of a huge pmd page. The effect may be in set_pte_at() > since we may pass an invalid page struct, if set_pte_at() wants to > access the page struct (e.g. CONFIG_PAGE_TABLE_CHECK is enabled), it > may crash the kernel. So fix it. And inline __split_vmemmap_huge_pmd() > since it only has one user. Is this likely enough to justify a backport? I'm thinking "add cc:stable and merge into 6.6-rc1", so it hits -stable after a couple of months of testing.