CVE-2022-49393

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49393
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49393.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49393
Downstream
Published
2025-02-26T02:11:24Z
Modified
2025-10-15T20:36:27.693531Z
Summary
misc: fastrpc: fix list iterator in fastrpc_req_mem_unmap_impl
Details

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

misc: fastrpc: fix list iterator in fastrpcreqmemunmapimpl

This is another instance of incorrect use of list iterator and checking it for NULL.

The list iterator value 'map' will always be set and non-NULL by listforeach_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty (in this case, the check 'if (!map) {' will always be false and never exit as expected).

To fix the bug, use a new variable 'iter' as the list iterator, while use the original variable 'map' as a dedicated pointer to point to the found element.

Without this patch, Kernel crashes with below trace:

Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000ffff7fb03750 ... Call trace: fastrpcmapcreate+0x70/0x290 [fastrpc] fastrpcreqmemmap+0xf0/0x2dc [fastrpc] fastrpcdeviceioctl+0x138/0xc60 [fastrpc] _arm64sysioctl+0xa8/0xec invokesyscall+0x48/0x114 el0svccommon.constprop.0+0xd4/0xfc doel0svc+0x28/0x90 el0svc+0x3c/0x130 el0t64synchandler+0xa4/0x130 el0t64_sync+0x18c/0x190 Code: 14000016 f94000a5 eb05029f 54000260 (b94018a6) ---[ end trace 0000000000000000 ]---

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5c1b97c7d7b736e6439af4f43a65837bc72f56c1
Fixed
2d12905aad462383f4e7a5fdb024d2b7ae2d10cf
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5c1b97c7d7b736e6439af4f43a65837bc72f56c1
Fixed
c5c07c5958cf0c9af6e76813e6de15d42ee49822

Affected versions

v5.*

v5.17
v5.17-rc7
v5.17-rc8
v5.18
v5.18-rc1
v5.18-rc2
v5.18-rc3
v5.18-rc4
v5.18-rc5
v5.18-rc6
v5.18-rc7
v5.18.1
v5.18.2

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.18.0
Fixed
5.18.3