[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95f6eec3-62f7-46d8-9bb1-664fb9e36534@bytedance.com>
Date: Wed, 24 Aug 2022 16:38:00 +0800
From: Lei He <helei.sig11@...edance.com>
To: mst@...hat.com, herbert@...dor.apana.org.au,
arei.gonglei@...wei.com
Cc: helei.sig11@...edance.com,
virtualization@...ts.linux-foundation.org,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
pizhenwei@...edance.com
Subject: PING: [PATCH v2] virtio-crypto: fix memory-leak
On 2022/8/16 下午5:43, Lei He wrote:
> From: lei he <helei.sig11@...edance.com>
>
> Fix memory-leak for virtio-crypto akcipher request, this problem is
> introduced by 59ca6c93387d3(virtio-crypto: implement RSA algorithm).
> The leak can be reproduced and tested with the following script
> inside virtual machine:
>
> Signed-off-by: lei he <helei.sig11@...edance.com>
> Acked-by: Michael S. Tsirkin <mst@...hat.com>
> Reviewed-by: Gonglei <arei.gonglei@...wei.com>
> ---
> drivers/crypto/virtio/virtio_crypto_akcipher_algs.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c
> index 2a60d0525cde..168195672e2e 100644
> --- a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c
> +++ b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c
> @@ -56,6 +56,10 @@ static void virtio_crypto_akcipher_finalize_req(
> struct virtio_crypto_akcipher_request *vc_akcipher_req,
> struct akcipher_request *req, int err)
> {
> + kfree(vc_akcipher_req->src_buf);
> + kfree(vc_akcipher_req->dst_buf);
> + vc_akcipher_req->src_buf = NULL;
> + vc_akcipher_req->dst_buf = NULL;
> virtcrypto_clear_request(&vc_akcipher_req->base);
>
> crypto_finalize_akcipher_request(vc_akcipher_req->base.dataq->engine, req, err);
>
> base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868
PING.
Best regards,
Lei He
--
helei.sig11@...edance.com
Powered by blists - more mailing lists