mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lei He <helei.sig11@bytedance.com>
To: mst@redhat.com, herbert@gondor.apana.org.au, arei.gonglei@huawei.com
Cc: helei.sig11@bytedance.com,
	virtualization@lists.linux-foundation.org,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	pizhenwei@bytedance.com
Subject: PING: [PATCH v2] virtio-crypto: fix memory-leak
Date: Wed, 24 Aug 2022 16:38:00 +0800	[thread overview]
Message-ID: <95f6eec3-62f7-46d8-9bb1-664fb9e36534@bytedance.com> (raw)
In-Reply-To: <20220816094336.27806-1-helei.sig11@bytedance.com>

On 2022/8/16 下午5:43, Lei He wrote:
> From: lei he <helei.sig11@bytedance.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@bytedance.com>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> Reviewed-by: Gonglei <arei.gonglei@huawei.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@bytedance.com


  reply	other threads:[~2022-08-24  8:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16  9:43 Lei He
2022-08-24  8:38 ` Lei He [this message]
2022-09-02  2:44   ` PING: " Lei He

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=95f6eec3-62f7-46d8-9bb1-664fb9e36534@bytedance.com \
    --to=helei.sig11@bytedance.com \
    --cc=arei.gonglei@huawei.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pizhenwei@bytedance.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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®