CVE-2022-50707: virtio-crypto: fix memory leak in virtio_crypto_alg_skcipher_close_session()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
virtio-crypto: fix memory leak in virtio_crypto_alg_skcipher_close_session()
'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.
The Linux kernel CVE team has assigned CVE-2022-50707 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.19 with commit 0756ad15b1fef287d4d8fa11bc36ea77a5c42e4a and fixed in 6.0.19 with commit 67fb59ff1384e338679c0eb7a43c83ce8868c9fa Issue introduced in 5.19 with commit 0756ad15b1fef287d4d8fa11bc36ea77a5c42e4a and fixed in 6.1.5 with commit 0871df190fe6723464efe0f493d476411616f553 Issue introduced in 5.19 with commit 0756ad15b1fef287d4d8fa11bc36ea77a5c42e4a and fixed in 6.2 with commit b1d65f717cd6305a396a8738e022c6f7c65cfbe8
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2022-50707
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/crypto/virtio/virtio_crypto_skcipher_algs.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/79026a2d0a1b080257773d22a493f9bcab8c65be https://git.kernel.org/stable/c/67fb59ff1384e338679c0eb7a43c83ce8868c9fa https://git.kernel.org/stable/c/0871df190fe6723464efe0f493d476411616f553 https://git.kernel.org/stable/c/b1d65f717cd6305a396a8738e022c6f7c65cfbe8