Skip to contentSkip to conversation

CVE-2026-45950: crypto: starfive - Fix memory leak in starfive_aes_aead_do_one_req()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message May 27

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

crypto: starfive - Fix memory leak in starfive_aes_aead_do_one_req()

The starfive_aes_aead_do_one_req() function allocates rctx->adata with kzalloc() but fails to free it if sg_copy_to_buffer() or starfive_aes_hw_init() fails, which lead to memory leaks.

Since rctx->adata is unconditionally freed after the write_adata operations, ensure consistent cleanup by freeing the allocation in these earlier error paths as well.

Compile tested only. Issue found using a prototype static analysis tool and code review.

The Linux kernel CVE team has assigned CVE-2026-45950 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.10 with commit 7467147ef9bf42d1ea5b3314c7a05cd542b3518e and fixed in 6.12.75 with commit 38d80307decc1132626a30e2a62af734630ecca5
	Issue introduced in 6.10 with commit 7467147ef9bf42d1ea5b3314c7a05cd542b3518e and fixed in 6.18.14 with commit 4869d0e4e48a5301b267d359b2561c4080791a55
	Issue introduced in 6.10 with commit 7467147ef9bf42d1ea5b3314c7a05cd542b3518e and fixed in 6.19.4 with commit 5f2c964a058581e1557c32d5de651c67a80438a7
	Issue introduced in 6.10 with commit 7467147ef9bf42d1ea5b3314c7a05cd542b3518e and fixed in 7.0 with commit ccb679fdae2e62ed92fd9acb25ed809c0226fcc6

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-2026-45950

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/starfive/jh7110-aes.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/38d80307decc1132626a30e2a62af734630ecca5
	https://git.kernel.org/stable/c/4869d0e4e48a5301b267d359b2561c4080791a55
	https://git.kernel.org/stable/c/5f2c964a058581e1557c32d5de651c67a80438a7
	https://git.kernel.org/stable/c/ccb679fdae2e62ed92fd9acb25ed809c0226fcc6