Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2207379iof; Tue, 7 Jun 2022 23:13:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZm9PtMCtDdL/HGq1jC4nPWkx4Wh/NNidJE7SvIpfwV3S1c2+vljZ45KLbSG6qfRp3z3bB X-Received: by 2002:a17:902:e484:b0:167:5b79:2b61 with SMTP id i4-20020a170902e48400b001675b792b61mr21479824ple.132.1654668790117; Tue, 07 Jun 2022 23:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668790; cv=none; d=google.com; s=arc-20160816; b=JtQ7fdeQshyiWMQWxScuFk8yKakgS/UEB7oXcncz6GQN7UNj9CPV82qbZW6F6xIjiL szHhycFg13eDdcR5HkyRxwIDewRc1GUIKI1cXkmpbaYy8Q6by33WbmXB9HxaSy41S8vo hvlUp5ILvzpWltwn08KeksRnDYsuT+2N0z5lNGOZbuy5premeMl1eqpRB1MUsSdBQHRP ZAsrRyaCCijIwNwjVzAzukOoa1GgT3+aQ3FM60jJhGotSKz8TLrXIzL1wKyhSGtJrTU5 4JixdAFjNPbz4QqmoQk+Ts7GvouJqVKNy7QnI/QiU0Y0LmQWcepK2oA90jzuedtviFr1 7f8A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nnXpkgIdPI/nlaY307NxlrhLXmlydH8LllTT4dmm2/A=; b=ZbF+x4FeMCgnFIqBUwhxYt3depvzjVUhj1+jht1eTYAguBAkgXWXi73p5v39/eCk3u gNPeLhQEo3aMyvmiZVkDVWKTx985sQC18zVUJe4ahbAMo7FVOSz7He6Xzs89ZNHxvRZ4 PnsKXHhda7YJjgSLmmDKPTRcis2ixlzSp+Li10PYo21ZYDcUmwI3P1Xp3T7AJ+Y/QPP/ ApO9PQjtJuMNw5tHcp8QK1ga6ez9uNAX05F/603DTdH9QlWP1hb1iIumB0UNLOAGLthc /9Pv/KuFd67sKoCEj5TyiuqUel2eQhN8A2UCThjya6tx2LBH9jOxuzd7dOegt+msAPtz ctkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LTiQKUwL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h11-20020a170902eecb00b00161f8628ed7si25505966plb.238.2022.06.07.23.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:13:10 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LTiQKUwL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 50C9F356397; Tue, 7 Jun 2022 22:35:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390982AbiFHBwB (ORCPT + 99 others); Tue, 7 Jun 2022 21:52:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383160AbiFGWam (ORCPT ); Tue, 7 Jun 2022 18:30:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A4AC275584; Tue, 7 Jun 2022 12:23:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4D449B823CE; Tue, 7 Jun 2022 19:23:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7614C385A2; Tue, 7 Jun 2022 19:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629833; bh=VPxZ/GdfHEX7gRFDxyW4jJq1K2qEinKRi73TYp6DpWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LTiQKUwLfEXq6J91AgNOUJNIsett/GlTXyIx41i1745v8ZBJ8BdYTxEtpt/YdrmyE pk8zN3Dj3h/iMa78fiA/2MIojueD1YA0eiKDgq5/FIpdNv1dtjBxpFaeBt9ldSBHoP kLTlyNYLZ9x81KTrT1092e99DJ5ubJRudLz7nGM0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaohe Lin , David Hildenbrand , Muchun Song , Anshuman Khandual , Oscar Salvador , Andrew Morton Subject: [PATCH 5.18 833/879] mm/memremap: fix missing call to untrack_pfn() in pagemap_range() Date: Tue, 7 Jun 2022 19:05:51 +0200 Message-Id: <20220607165027.035342389@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Miaohe Lin commit a04e1928e2ead144dc2f369768bc0a0f3110af89 upstream. We forget to call untrack_pfn() to pair with track_pfn_remap() when range is not allowed to hotplug. Fix it by jump err_kasan. Link: https://lkml.kernel.org/r/20220531122643.25249-1-linmiaohe@huawei.com Fixes: bca3feaa0764 ("mm/memory_hotplug: prevalidate the address range being added with platform") Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Acked-by: Muchun Song Cc: Anshuman Khandual Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- mm/memremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/memremap.c +++ b/mm/memremap.c @@ -214,7 +214,7 @@ static int pagemap_range(struct dev_page if (!mhp_range_allowed(range->start, range_len(range), !is_private)) { error = -EINVAL; - goto err_pfn_remap; + goto err_kasan; } mem_hotplug_begin();