Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp702688ybi; Fri, 12 Jul 2019 03:18:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqet1TXNSJB/lcyiGUR43gBTdYh+U61L1klwT7wFGWa1eAbEughaXTRpF/Pv+u6KauStFv X-Received: by 2002:a63:4f45:: with SMTP id p5mr10019341pgl.326.1562926709390; Fri, 12 Jul 2019 03:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562926709; cv=none; d=google.com; s=arc-20160816; b=M5TrEI6Ap2tSGHPmIPbbMPmox6ma4AeLC/P0uecv7BzAc5PydXXtZNDSl9j7TLXdJz 8d+HpBGpgyOd2LUuCsLlbmEiweTuw3lwvIBCPZmcYvgMrQdxOs2OAGoZxRZimi+NJygk jiXv0oVS2BY3E3LU0fJRYbML8LpKA1fwjMl8eoyQUTiS7oTR7bk8EZgTyUy02PSppqf8 6rreExEhjx8aFRgRKFR80VmO5DbIigLOcl9kK5F6Ax3oPl1mCtq44qW7cu4B/HqMfY+3 2jVRiwl171tdGH5P3XyBp1PSZnni872DbBNapq04UWQ/F6lE3L9csV+9FTZyzSTSfVWp 1QEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=E3ePDC6XoNk1kUvdcVwu5DVYLdqHs+WzQ/xqNKjjHa0=; b=Vb21YZ89koIUi2c+9ETHiwZWYtRRXuPEm3B0UqahsYrgKdkxCeLWi0x3+1qlKByBE2 s/FjVJ0fc7/gqI3rJFptdukWPo6hoIeNzYQDxsq5q1Ojnbyj/OfwUpl+chID5+2TTDu/ sB7IsHiCq0fi4RaTdRMcIJq3zkIcfeuf0BzCOl8MkoLVh1tECGfcOAdg5Jw2dWiZ3ZcR Rf+JbEPi/ZSYzweRJeSs4IYSQAo2nP0QD/tedexCLHOcCpHiYR/NgvKefC5/XBjnHqEe yAIhJFF+2NQue41GcNtN2GfPqwRU1scj3rtHnDFRoJmnvmg4ybwBKQu08vQLKtVpA1+J padw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si7843936pfi.31.2019.07.12.03.18.15; Fri, 12 Jul 2019 03:18:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726196AbfGLKSM (ORCPT + 99 others); Fri, 12 Jul 2019 06:18:12 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:44154 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbfGLKSM (ORCPT ); Fri, 12 Jul 2019 06:18:12 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hlsck-0005dS-D9; Fri, 12 Jul 2019 18:17:54 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hlscb-0008KQ-6Y; Fri, 12 Jul 2019 18:17:45 +0800 Date: Fri, 12 Jul 2019 18:17:45 +0800 From: Herbert Xu To: Wen Yang Cc: linux-kernel@vger.kernel.org, xue.zhihong@zte.com.cn, wang.yi59@zte.com.cn, cheng.shengyu@zte.com.cn, "David S. Miller" , Thomas Gleixner , Greg Kroah-Hartman , Allison Randal , Armijn Hemel , Julia Lawall , linux-crypto@vger.kernel.org Subject: Re: [PATCH] crypto: crypto4xx: fix a potential double free in ppc4xx_trng_probe Message-ID: <20190712101745.3owecyrrpltsozmy@gondor.apana.org.au> References: <1562566745-7447-1-git-send-email-wen.yang99@zte.com.cn> <1562566745-7447-2-git-send-email-wen.yang99@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1562566745-7447-2-git-send-email-wen.yang99@zte.com.cn> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, Jul 08, 2019 at 02:19:03PM +0800, Wen Yang wrote: > There is a possible double free issue in ppc4xx_trng_probe(): > > 85: dev->trng_base = of_iomap(trng, 0); > 86: of_node_put(trng); ---> released here > 87: if (!dev->trng_base) > 88: goto err_out; > ... > 110: ierr_out: > 111: of_node_put(trng); ---> double released here > ... > > This issue was detected by using the Coccinelle software. > We fix it by removing the unnecessary of_node_put(). > > Fixes: 5343e674f32 ("crypto4xx: integrate ppc4xx-rng into crypto4xx") > Signed-off-by: Wen Yang > Cc: Herbert Xu > Cc: "David S. Miller" > Cc: Thomas Gleixner > Cc: Greg Kroah-Hartman > Cc: Allison Randal > Cc: Armijn Hemel > Cc: Julia Lawall > Cc: linux-crypto@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > --- > drivers/crypto/amcc/crypto4xx_trng.c | 1 - > 1 file changed, 1 deletion(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt