[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zd82q8lw_qH7KLCs@skv.local>
Date: Wed, 28 Feb 2024 16:35:39 +0300
From: Andrey Skvortsov <andrej.skvortzov@...il.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Corentin Labbe <clabbe.montjoie@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>,
Jonathan Corbet <corbet@....net>,
Ovidiu Panait <ovidiu.panait@...driver.com>,
linux-crypto@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-sunxi@...ts.linux.dev, linux-kernel@...r.kernel.org,
Arnaud Ferraris <arnaud.ferraris@...labora.com>
Subject: Re: [PATCH] crypto: rk3288 - Fix use after free in unprepare
On 24-02-28 17:13, Herbert Xu wrote:
> The unprepare call must be carried out before the finalize call
> as the latter can free the request.
>
> Fixes: c66c17a0f69b ("crypto: rk3288 - Remove prepare/unprepare request")
> Reported-by: Andrey Skvortsov <andrej.skvortzov@...il.com>
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Herbert Xu <herbert@...dor.apana.org.au>
>
> diff --git a/drivers/crypto/rockchip/rk3288_crypto_ahash.c b/drivers/crypto/rockchip/rk3288_crypto_ahash.c
> index 1b13b4aa16ec..a235e6c300f1 100644
> --- a/drivers/crypto/rockchip/rk3288_crypto_ahash.c
> +++ b/drivers/crypto/rockchip/rk3288_crypto_ahash.c
> @@ -332,12 +332,12 @@ static int rk_hash_run(struct crypto_engine *engine, void *breq)
> theend:
> pm_runtime_put_autosuspend(rkc->dev);
>
> + rk_hash_unprepare(engine, breq);
> +
> local_bh_disable();
> crypto_finalize_hash_request(engine, breq, err);
> local_bh_enable();
>
> - rk_hash_unprepare(engine, breq);
> -
> return 0;
> }
>
Thanks, that was quick. I had locally the same change.
Reviewed-by: Andrey Skvortsov <andrej.skvortzov@...il.com>
--
Best regards,
Andrey Skvortsov
Powered by blists - more mailing lists