Subject: CVE-2021-47053: crypto: sun8i-ss - Fix memory leak of pad

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

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

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

crypto: sun8i-ss - Fix memory leak of pad

It appears there are several failure return paths that don't seem
to be free'ing pad. Fix these.

Addresses-Coverity: ("Resource leak")

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

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

	Issue introduced in 5.10 with commit d9b45418a917 and fixed in 5.10.37 with commit 2c67a9333da9
	Issue introduced in 5.10 with commit d9b45418a917 and fixed in 5.11.21 with commit c633e025bd04
	Issue introduced in 5.10 with commit d9b45418a917 and fixed in 5.12.4 with commit d3d702084d12
	Issue introduced in 5.10 with commit d9b45418a917 and fixed in 5.13 with commit 50274b01ac16

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-47053
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/2c67a9333da9d0a3b87310e0d116b7c9070c7b00
	https://git.kernel.org/stable/c/c633e025bd04f54d7b33331cfcdb71354b08ce59
	https://git.kernel.org/stable/c/d3d702084d125689edb2b9395c707e09b471352e
	https://git.kernel.org/stable/c/50274b01ac1689b1a3f6bc4b5b3dbf361a55dd3a