Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1434527rwd; Thu, 8 Jun 2023 18:40:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6KdSI78pIe7gCmAPxSx94QOiMxmGIhc1vY5icL10VFZFmiXseitOw8oKvn5iyrBHrJUoJS X-Received: by 2002:a05:6358:4e9e:b0:129:bc0b:aac2 with SMTP id ce30-20020a0563584e9e00b00129bc0baac2mr74956rwb.7.1686274811745; Thu, 08 Jun 2023 18:40:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686274811; cv=none; d=google.com; s=arc-20160816; b=IaiFEzr/IwaCzbeT67zEI0bGwuoS5+jfWSnY5MKkSCyvv7pB6inTJBvU44i8iJX7Q8 Ps4KtIZbVq1X2lSQLKAw2X+lGMkYA0iKPUFb3Ep0xySMPVYxO9hmPSQ50HFlNKu0wVnw vJOZif3cv0rXPgA/+tS4B1TY5LDPD5kwCSkhZEEJegQlbV+qtLsnJ7czvfWKq64xip/0 bCWQxc+zCTbuwyd9Wd2VsW2YHVr30XIPfn2Rww4IwYUL0hh3gOq7rCgGZ8njM09XK8gk FchvmlsLfus40KtFv1e3EDT3Ar1kBX84QvyTH53Nr1XJ7FgeTX6x6JaJ1AOTyoJMg/hy aKpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=ngswcYXh32wJZMu4ey5160LWyE599vrHnWvZmx6kKak=; b=faafljRLZbA94vQVYwAy17331IcwSv3zqOk1p27a32RyNV3uRajM/bQiwmUiyZ30od Uojit19qqV7N/+a+BgwaHwTWKvwLBWhu70zP+ouObofsuE9hKxtocVFL95YvSWI57Kka am81qjqGxo6IwUtfArRflaG/eWzhsO4wD0sgv3MIuTtDzQkrXY7VOXNraJXvNRC6WTRY K9ANW3Wr53AVG6LqjVrOs27PA6U1JwprTUHB/MZIOfekCKKGo3xAwHY4tr7ivTRwVqeZ CfZLdBSskaJN3Hhq4rFzwI1FZH5lvOSzqRgTPHd0LTRtuyI9NkELsrTws7sVOkCN1PDf iTcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=DCQmA7jy; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o7-20020a639207000000b0053f0bfcd4fasi1843789pgd.173.2023.06.08.18.39.56; Thu, 08 Jun 2023 18:40:11 -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=@google.com header.s=20221208 header.b=DCQmA7jy; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237646AbjFIBV6 (ORCPT + 99 others); Thu, 8 Jun 2023 21:21:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237618AbjFIBVr (ORCPT ); Thu, 8 Jun 2023 21:21:47 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3F611FDF for ; Thu, 8 Jun 2023 18:21:46 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id 3f1490d57ef6-bb3d122a19fso1262860276.0 for ; Thu, 08 Jun 2023 18:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686273706; x=1688865706; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=ngswcYXh32wJZMu4ey5160LWyE599vrHnWvZmx6kKak=; b=DCQmA7jyE39MLlNzgNj5Fnvt6VxEVhxfR43nyr9O34TsE/NR89GCRNiD4ZoZdR4Qh/ VVlLGnas01pgDThKof5oMLzzf1GcWd8TwEjNBhNMTY02KeG47WG7BA2R3pdxHonu/WZa V3CvdasgvhS1HvjB0i2UUPMQsDXJR6NqotUE643j7wgPp8AFNy/qFFWZUuLH+fdomurR thKNoJK95KQaiNcwFeztAb+d5ZaqpXtxhvroVgVoxsGEe35huAPILPbeWC7G/RPecM4M XWHbDzBCI7PfoB33hTMYlIVyb/ngBEvTOCi3mr/ilks4HMOz+anwKzwFIqfyaYnbXfBU DGJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686273706; x=1688865706; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ngswcYXh32wJZMu4ey5160LWyE599vrHnWvZmx6kKak=; b=SAiSofQJRF/nlWxzRZhgeBSxX7agnwj6cK7jw0DMVcRHkv/uDdOKkaDHdlUYOsXU1E iSrKvOiZBC5akRbzaoJ/0kEnQDFUgfh4dDMcRwu0JdS2rOSutOeCxhonRpyu6sFl3SUj Z1BSMz1J8H1nQRkQfrmt4bbOk7eSldr73YL36oeISAHHHi9FVPaRZpFmDZ4L0eji5sqo Ie+QMUzBgGflNqCrD2yHM2zRo7o5StC26ZORynPsbVIn+qmzJiKV3UrBJH2M+nFsVhUq m8CvkXq8IAHticA7GuRSsJEjQJFg8j5ZChx7YvrstpZIu0TYIAqf3IAomJkrt6e313nG Puig== X-Gm-Message-State: AC+VfDzg2BTBr4MPnj2kXmzg9Fzd3zjL3g3z7cIn13FLXQ9bvZeb8Qm+ 2O3VLRGITpII4yzfzYofszDgfg== X-Received: by 2002:a25:f501:0:b0:bb3:9255:33e9 with SMTP id a1-20020a25f501000000b00bb3925533e9mr1145250ybe.53.1686273705789; Thu, 08 Jun 2023 18:21:45 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id t12-20020a5b0dcc000000b00bb138b444dcsm586743ybr.36.2023.06.08.18.21.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 18:21:44 -0700 (PDT) Date: Thu, 8 Jun 2023 18:21:41 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Yang Shi , Mel Gorman , Peter Xu , Peter Zijlstra , Will Deacon , Yu Zhao , Alistair Popple , Ralph Campbell , Ira Weiny , Steven Price , SeongJae Park , Lorenzo Stoakes , Huang Ying , Naoya Horiguchi , Christophe Leroy , Zack Rusin , Jason Gunthorpe , Axel Rasmussen , Anshuman Khandual , Pasha Tatashin , Miaohe Lin , Minchan Kim , Christoph Hellwig , Song Liu , Thomas Hellstrom , Ryan Roberts , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 12/32] mm/vmalloc: vmalloc_to_page() use pte_offset_kernel() In-Reply-To: Message-ID: <696386a-84f8-b33c-82e5-f865ed6eb39@google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 vmalloc_to_page() was using pte_offset_map() (followed by pte_unmap()), but it's intended for userspace page tables: prefer pte_offset_kernel(). Signed-off-by: Hugh Dickins Reviewed-by: Lorenzo Stoakes --- mm/vmalloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 9683573f1225..741722d247d5 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -703,11 +703,10 @@ struct page *vmalloc_to_page(const void *vmalloc_addr) if (WARN_ON_ONCE(pmd_bad(*pmd))) return NULL; - ptep = pte_offset_map(pmd, addr); + ptep = pte_offset_kernel(pmd, addr); pte = *ptep; if (pte_present(pte)) page = pte_page(pte); - pte_unmap(ptep); return page; } -- 2.35.3