Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2454002rdb; Sun, 3 Dec 2023 18:28:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHh7rU4vFrK0ZyvJoxGViM4rglNIdTyObmoEVRaCZYec1UBJFu4Y0fPCZNlILHiCpp10um0 X-Received: by 2002:a05:6a00:84a:b0:6ce:2731:a083 with SMTP id q10-20020a056a00084a00b006ce2731a083mr4441771pfk.50.1701656896148; Sun, 03 Dec 2023 18:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701656896; cv=none; d=google.com; s=arc-20160816; b=m3EYHX3L1/JclcnEAatMOfAEtw4oYdpqbC/NfgMqe2Z6keYGYM38UIKVvsexBVlbwp RDfjep/zt495gAZlXiYaF0P0gGg2H9tob7gIUgsXhIhvgel9bqu6VH1QwoBe56ki7dCa zLs9DkY7tVIgiWTdM4luSJHZtr3BjIGjKdEEw5/aZd/co3h4KIQqNHbvzZDHlu2rphKt DgNG95WEqLgeEPHlGvpBKt6Qia83Tymu9VKBVViocLqGEMP+nVI4gx66SQuxzIMG5cKw i5kiXdjRfYwqgoojU6Z/fDttgY7eUir/msBkrrtfORFemoSmhC4t/9EeNbwUkkoxzRtM GZmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Z4rDl5qtgKzOtSjHYSX5G7W3dXvqAOlMLlXftCLz62I=; fh=lfz6mylb539yuOMpGz9V5EL3tJXI+AYSvbAmj3sj0lU=; b=P+dGUyYESZedQvDkx+zVNUGRKxoL1+vCIn4CD6mKW3IvEqajs2Y0ZUJHLEWQTjkrwK FqWoElQoRuqwDHlrESNPOgGSTI7H2KAUJZqiy+atA1LHBLfhJ8Hb4QPg+JqN+sYjkCAa MrxokiGqvfcwERWR8mWp1M2aS+v4VluAcUj+EVRuECeIUERiYxSeHDZ/djPYcfl8gJzN NDHYoCB+hiah+fM63hDo3DVYIqei8Jn+LBCKdwca1TbUTNuxiNs3Ph3jFgqoE3DFeU0P Rk+oge1hYGqI+o4BRQtujmF8itGoQuBaNlS7KI6/PqHAeV9YvQTQSh/4cKMmmvBNkXYe cxJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id v7-20020a655c47000000b005893c5bd119si6838383pgr.425.2023.12.03.18.28.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 18:28:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C986C809849E; Sun, 3 Dec 2023 18:28:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234342AbjLDC1z (ORCPT + 99 others); Sun, 3 Dec 2023 21:27:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230141AbjLDC1z (ORCPT ); Sun, 3 Dec 2023 21:27:55 -0500 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4E6BC1 for ; Sun, 3 Dec 2023 18:27:59 -0800 (PST) X-UUID: a156a3a52da548fca377d46206efd6dc-20231204 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.33,REQID:58783b7a-b7ad-4933-98ae-b467bde845a3,IP:10, URL:0,TC:0,Content:-5,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACT ION:release,TS:-10 X-CID-INFO: VERSION:1.1.33,REQID:58783b7a-b7ad-4933-98ae-b467bde845a3,IP:10,UR L:0,TC:0,Content:-5,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-10 X-CID-META: VersionHash:364b77b,CLOUDID:5fb5c560-c89d-4129-91cb-8ebfae4653fc,B ulkID:231204102756QBXUMQUM,BulkQuantity:0,Recheck:0,SF:19|44|66|38|24|17|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,CO L:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: a156a3a52da548fca377d46206efd6dc-20231204 X-User: chentao@kylinos.cn Received: from [172.21.13.26] [(116.128.244.171)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1655860228; Mon, 04 Dec 2023 10:27:53 +0800 Message-ID: <2a0d2c32-5548-445e-a67e-db48157685d7@kylinos.cn> Date: Mon, 4 Dec 2023 10:27:47 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] powerpc/mm: Fix null-pointer dereference in pgtable_cache_add Content-Language: en-US To: Michael Ellerman , npiggin@gmail.com, christophe.leroy@csgroup.eu Cc: kunwu.chan@hotmail.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20231130090953.2322490-1-chentao@kylinos.cn> <87cyvq1b2f.fsf@mail.lhotse> From: Kunwu Chan In-Reply-To: <87cyvq1b2f.fsf@mail.lhotse> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 03 Dec 2023 18:28:14 -0800 (PST) Sure,i'll follow your suggestion in v3 patch: 1. set new to NULL 2. add a 'if' judgment before 'kmem_cache_create' Thanks, Kunwu On 2023/12/1 18:17, Michael Ellerman wrote: > avoid two calls to panic