Subject: CVE-2021-47059: crypto: sun8i-ss - fix result memory leak on error path

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

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

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

crypto: sun8i-ss - fix result memory leak on error path

This patch fixes a memory leak on an error path.

The Linux kernel CVE team has assigned CVE-2021-47059 to this issue.

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

	Issue introduced in 5.10 with commit d9b45418a917 and fixed in 5.10.37 with commit 1f12aaf07f61
	Issue introduced in 5.10 with commit d9b45418a917 and fixed in 5.11.21 with commit ca065a93699f
	Issue introduced in 5.10 with commit d9b45418a917 and fixed in 5.12.4 with commit 50e7b39b8084
	Issue introduced in 5.10 with commit d9b45418a917 and fixed in 5.13 with commit 1dbc6a1e25be

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-2021-47059
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/allwinner/sun8i-ss/sun8i-ss-hash.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/1f12aaf07f61122cf5074d29714ee26f8d44b0e7
	https://git.kernel.org/stable/c/ca065a93699f8cf3f42c60eefed73086007e928e
	https://git.kernel.org/stable/c/50e7b39b808430ad49a637dc6fb72ca93b451b13
	https://git.kernel.org/stable/c/1dbc6a1e25be8575d6c4114d1d2b841a796507f7