From: Julia Lawall <julia.lawall@lip6.fr>
To: Wen Yang <wen.yang99@zte.com.cn>
Cc: linux-kernel@vger.kernel.org, xue.zhihong@zte.com.cn,
wang.yi59@zte.com.cn, cheng.shengyu@zte.com.cn,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Thomas Gleixner <tglx@linutronix.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Allison Randal <allison@lohutok.net>,
Armijn Hemel <armijn@tjaldur.nl>,
Julia Lawall <Julia.Lawall@lip6.fr>,
linux-crypto@vger.kernel.org
Subject: Re: [PATCH] crypto: crypto4xx: fix a potential double free in ppc4xx_trng_probe
Date: Mon, 8 Jul 2019 08:27:22 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.21.1907080827080.2585@hadrien> (raw)
In-Reply-To: <1562566745-7447-2-git-send-email-wen.yang99@zte.com.cn>
On Mon, 8 Jul 2019, 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 <wen.yang99@zte.com.cn>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Allison Randal <allison@lohutok.net>
> Cc: Armijn Hemel <armijn@tjaldur.nl>
> Cc: Julia Lawall <Julia.Lawall@lip6.fr>
> Cc: linux-crypto@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
> ---
> drivers/crypto/amcc/crypto4xx_trng.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/crypto/amcc/crypto4xx_trng.c b/drivers/crypto/amcc/crypto4xx_trng.c
> index 02a6bed3..f10a87e 100644
> --- a/drivers/crypto/amcc/crypto4xx_trng.c
> +++ b/drivers/crypto/amcc/crypto4xx_trng.c
> @@ -108,7 +108,6 @@ void ppc4xx_trng_probe(struct crypto4xx_core_device *core_dev)
> return;
>
> err_out:
> - of_node_put(trng);
> iounmap(dev->trng_base);
> kfree(rng);
> dev->trng_base = NULL;
> --
> 2.9.5
>
>
next prev parent reply other threads:[~2019-07-08 6:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-08 6:19 [PATCH] cpufreq/pasemi: fix an use-after-free in pas_cpufreq_cpu_init() Wen Yang
2019-07-08 6:19 ` [PATCH] crypto: crypto4xx: fix a potential double free in ppc4xx_trng_probe Wen Yang
2019-07-08 6:27 ` Julia Lawall [this message]
2019-07-09 12:14 ` Coccinelle: Checking the deletion of duplicate of_node_put() calls with SmPL Markus Elfring
2019-07-10 5:55 ` Markus Elfring
2019-07-12 10:17 ` [PATCH] crypto: crypto4xx: fix a potential double free in ppc4xx_trng_probe Herbert Xu
2019-07-08 6:19 ` [PATCH] irqchip: renesas-rza1: fix an use-after-free in rza1_irqc_probe() Wen Yang
2019-07-08 7:36 ` Geert Uytterhoeven
2019-07-09 12:58 ` [tip:irq/urgent] irqchip/renesas-rza1: Prevent " tip-bot for Wen Yang
2019-07-26 13:41 ` [PATCH] irqchip: renesas-rza1: fix an " Marc Zyngier
2019-07-08 6:19 ` [PATCH] phy: ti: am654-serdes: fix an use-after-free in serdes_am654_clk_register() Wen Yang
2019-08-06 14:07 ` Roger Quadros
2019-07-08 6:27 ` [PATCH] cpufreq/pasemi: fix an use-after-free in pas_cpufreq_cpu_init() Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.21.1907080827080.2585@hadrien \
--to=julia.lawall@lip6.fr \
--cc=allison@lohutok.net \
--cc=armijn@tjaldur.nl \
--cc=cheng.shengyu@zte.com.cn \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=wang.yi59@zte.com.cn \
--cc=wen.yang99@zte.com.cn \
--cc=xue.zhihong@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®