Patch "virtio-crypto: fix memory leak in virtio_crypto_alg_skcipher_close_session()" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    virtio-crypto: fix memory leak in virtio_crypto_alg_skcipher_close_session()

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     virtio-crypto-fix-memory-leak-in-virtio_crypto_alg_skcipher_close_session.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From b1d65f717cd6305a396a8738e022c6f7c65cfbe8 Mon Sep 17 00:00:00 2001
From: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
Date: Mon, 14 Nov 2022 11:07:40 +0000
Subject: virtio-crypto: fix memory leak in virtio_crypto_alg_skcipher_close_session()

From: Wei Yongjun <weiyongjun1@xxxxxxxxxx>

commit b1d65f717cd6305a396a8738e022c6f7c65cfbe8 upstream.

'vc_ctrl_req' is alloced in virtio_crypto_alg_skcipher_close_session(),
and should be freed in the invalid ctrl_status->status error handling
case. Otherwise there is a memory leak.

Fixes: 0756ad15b1fe ("virtio-crypto: use private buffer for control request")
Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
Message-Id: <20221114110740.537276-1-weiyongjun@xxxxxxxxxxxxxxx>
Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
Reviewed-by: Gonglei <arei.gonglei@xxxxxxxxxx>
Acked-by: zhenwei pi<pizhenwei@xxxxxxxxxxxxx>
Acked-by: Jason Wang <jasowang@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/crypto/virtio/virtio_crypto_algs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/crypto/virtio/virtio_crypto_algs.c
+++ b/drivers/crypto/virtio/virtio_crypto_algs.c
@@ -239,7 +239,8 @@ static int virtio_crypto_alg_skcipher_cl
 		pr_err("virtio_crypto: Close session failed status: %u, session_id: 0x%llx\n",
 			ctrl_status->status, destroy_session->session_id);
 
-		return -EINVAL;
+		err = -EINVAL;
+		goto out;
 	}
 
 	err = 0;


Patches currently in stable-queue which might be from weiyongjun1@xxxxxxxxxx are

queue-5.10/virtio-crypto-fix-memory-leak-in-virtio_crypto_alg_skcipher_close_session.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux