CVE-2022-49952: misc: fastrpc: fix memory corruption on probe
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
misc: fastrpc: fix memory corruption on probe
Add the missing sanity check on the probed-session count to avoid corrupting memory beyond the fixed-size slab-allocated session array when there are more than FASTRPC_MAX_SESSIONS sessions defined in the devicetree.
The Linux kernel CVE team has assigned CVE-2022-49952 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.1 with commit f6f9279f2bf0e37e2f1fb119d8832b8568536a04 and fixed in 5.4.213 with commit ec186b9f4aa2e6444d5308a6cc268aada7007639 Issue introduced in 5.1 with commit f6f9279f2bf0e37e2f1fb119d8832b8568536a04 and fixed in 5.10.142 with commit c99bc901d5eb9fbdd7bd39f625e170ce97390336 Issue introduced in 5.1 with commit f6f9279f2bf0e37e2f1fb119d8832b8568536a04 and fixed in 5.15.66 with commit 0e33b0f322fecd7a92d9dc186535cdf97940a856 Issue introduced in 5.1 with commit f6f9279f2bf0e37e2f1fb119d8832b8568536a04 and fixed in 5.19.8 with commit c0425c2facd9166fa083f90c9f3187ace0c7837a Issue introduced in 5.1 with commit f6f9279f2bf0e37e2f1fb119d8832b8568536a04 and fixed in 6.0 with commit 9baa1415d9abdd1e08362ea2dcfadfacee8690b5
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-49952
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/ec186b9f4aa2e6444d5308a6cc268aada7007639 https://git.kernel.org/stable/c/c99bc901d5eb9fbdd7bd39f625e170ce97390336 https://git.kernel.org/stable/c/0e33b0f322fecd7a92d9dc186535cdf97940a856 https://git.kernel.org/stable/c/c0425c2facd9166fa083f90c9f3187ace0c7837a https://git.kernel.org/stable/c/9baa1415d9abdd1e08362ea2dcfadfacee8690b5