From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9725C433FF for ; Wed, 31 Jul 2019 09:44:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD9A2206A3 for ; Wed, 31 Jul 2019 09:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564566282; bh=9CQh+fppQvTOStqKiDukaYM+WtmIth11V+qgBeMjt+A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=PR0Ycy4gejuaFdpS7TnjEVhmUEiks8zpBMuOLh4955Uu3FR4xGNor+0Zk6St/xqoj udNpGnWBbzUDjHA7l5zgktBHN2Z/Dmu9tJAxdU9eELyuZT0OvwWc4CuE00W1DlhYKR OJz/JhmK9ubC9/px12LLsTby1hp+VXsqw+58jZ5M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728187AbfGaJol (ORCPT ); Wed, 31 Jul 2019 05:44:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:38214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbfGaJol (ORCPT ); Wed, 31 Jul 2019 05:44:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 950EC20665; Wed, 31 Jul 2019 09:44:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564566280; bh=9CQh+fppQvTOStqKiDukaYM+WtmIth11V+qgBeMjt+A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sb9wX3khpHjNdMDeSXgabrCnsVy1VQdsirBRGsSkZefxPDFxwgFvayNvYQ7LDrlc8 VGzqK1UvFOOC+oQsLd80o1+z7HDCc22ryiDnx9I5biBBtaob69W2fz0tIGMHrYIDYn HkIfyE4+xpuCgC6CsveV9sbGGQSfxxLWZUR/lnPc= Date: Wed, 31 Jul 2019 11:44:37 +0200 From: Greg KH To: Amit Pundir Cc: Stable , Wen Yang , "David S. Miller" , Thomas Gleixner , Allison Randal , Armijn Hemel , Julia Lawall , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Herbert Xu Subject: Re: [PATCH for-4.14.y 3/3] crypto: crypto4xx - fix a potential double free in ppc4xx_trng_probe Message-ID: <20190731094437.GF18269@kroah.com> References: <1564517913-17164-1-git-send-email-amit.pundir@linaro.org> <1564517913-17164-3-git-send-email-amit.pundir@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1564517913-17164-3-git-send-email-amit.pundir@linaro.org> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 31, 2019 at 01:48:33AM +0530, Amit Pundir wrote: > From: Wen Yang > > commit 95566aa75cd6b3b404502c06f66956b5481194b3 upstream. > > 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: 5343e674f32f ("crypto4xx: integrate ppc4xx-rng into crypto4xx") > Signed-off-by: Wen Yang > Cc: > 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 > Acked-by: Julia Lawall > Signed-off-by: Herbert Xu > Signed-off-by: Amit Pundir > --- > Cleanly apply on 4.9.y as well. This is already in the 4.14.135 kernel release. Are you sure we need it there again? thanks, greg k-h