Subject: CVE-2022-48873: misc: fastrpc: Don't remove map on creater_process and device_release

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

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

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

misc: fastrpc: Don't remove map on creater_process and device_release

Do not remove the map from the list on error path in
fastrpc_init_create_process, instead call fastrpc_map_put, to avoid
use-after-free. Do not remove it on fastrpc_device_release either,
call fastrpc_map_put instead.

The fastrpc_free_map is the only proper place to remove the map.
This is called only after the reference count is 0.

The Linux kernel CVE team has assigned CVE-2022-48873 to this issue.

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

	Issue introduced in 5.2 with commit b49f6d83e290 and fixed in 5.4.230 with commit 4b5c44e924a5
	Issue introduced in 5.2 with commit b49f6d83e290 and fixed in 5.10.165 with commit 193cd853145b
	Issue introduced in 5.2 with commit b49f6d83e290 and fixed in 5.15.90 with commit 1b7b7bb400dd
	Issue introduced in 5.2 with commit b49f6d83e290 and fixed in 6.1.8 with commit 35ddd482345c
	Issue introduced in 5.2 with commit b49f6d83e290 and fixed in 6.2 with commit 5bb96c8f9268
	Issue introduced in 5.1.6 with commit aaf5aa44934a

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-48873
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/misc/fastrpc.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/4b5c44e924a571d0ad07054de549624fbc04e4d7
	https://git.kernel.org/stable/c/193cd853145b63e670bd73740250983af1475330
	https://git.kernel.org/stable/c/1b7b7bb400dd13dcb03fc6e591bb7ca4664bbec8
	https://git.kernel.org/stable/c/35ddd482345c43d9eec1f3406c0f20a95ed4054b
	https://git.kernel.org/stable/c/5bb96c8f9268e2fdb0e5321cbc358ee5941efc15