{"id":"CVE-2022-48874","state":"PUBLISHED","title":"misc: fastrpc: Fix use-after-free and race in fastrpc_map_find","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmisc: fastrpc: Fix use-after-free and race in fastrpc_map_find\n\nCurrently, there is a race window between the point when the mutex is\nunlocked in fastrpc_map_lookup and the reference count increasing\n(fastrpc_map_get) in fastrpc_map_find, which can also lead to\nuse-after-free.\n\nSo lets merge fastrpc_map_find into fastrpc_map_lookup which allows us\nto both protect the maps list by also taking the &fl->lock spinlock and\nthe reference count, since the spinlock will be released only after.\nAdd take_ref argument to make this suitable for all callers.","publishedAt":"2024-08-21T06:10:05.081Z","updatedAt":"2026-08-05T08:52:45.133Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8f6c1d8c4f0cc316b0456788fff8373554d1d99d","status":"affected","lessThan":"a50c5c25b6e7d2824698c0e6385f882a18f4a498","versionType":"git"},{"version":"8f6c1d8c4f0cc316b0456788fff8373554d1d99d","status":"affected","lessThan":"9446fa1683a7e3937d9970248ced427c1983a1c5","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/misc/fastrpc.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.18","versionType":"semver"},{"version":"6.1.8","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/misc/fastrpc.c"]}],"references":["https://git.kernel.org/stable/c/a50c5c25b6e7d2824698c0e6385f882a18f4a498","https://git.kernel.org/stable/c/9446fa1683a7e3937d9970248ced427c1983a1c5"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/48xxx/CVE-2022-48874.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-48874","state":"PUBLISHED","datePublished":"2024-08-21T06:10:05.081Z","dateUpdated":"2026-08-05T08:52:45.133Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-07-16T11:38:08.921Z"},"containers":{"cna":{"title":"misc: fastrpc: Fix use-after-free and race in fastrpc_map_find","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmisc: fastrpc: Fix use-after-free and race in fastrpc_map_find\n\nCurrently, there is a race window between the point when the mutex is\nunlocked in fastrpc_map_lookup and the reference count increasing\n(fastrpc_map_get) in fastrpc_map_find, which can also lead to\nuse-after-free.\n\nSo lets merge fastrpc_map_find into fastrpc_map_lookup which allows us\nto both protect the maps list by also taking the &fl->lock spinlock and\nthe reference count, since the spinlock will be released only after.\nAdd take_ref argument to make this suitable for all callers."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8f6c1d8c4f0cc316b0456788fff8373554d1d99d","status":"affected","lessThan":"a50c5c25b6e7d2824698c0e6385f882a18f4a498","versionType":"git"},{"version":"8f6c1d8c4f0cc316b0456788fff8373554d1d99d","status":"affected","lessThan":"9446fa1683a7e3937d9970248ced427c1983a1c5","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/misc/fastrpc.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.18","versionType":"semver"},{"version":"6.1.8","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/misc/fastrpc.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/a50c5c25b6e7d2824698c0e6385f882a18f4a498"},{"url":"https://git.kernel.org/stable/c/9446fa1683a7e3937d9970248ced427c1983a1c5"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerability is reached only through local ioctls on /dev/fastrpc-* misc devices (FASTRPC_IOCTL_INVOKE / MEM_MAP / MEM_UNMAP) via fastrpc_device_ioctl → fastrpc_map_create → fastrpc_map_find; it is not reachable from network packet processing.\nAC:L - The attacker controls both sides of the race by issuing concurrent ioctls from multiple threads on the same fastrpc fd (e.g. map_find via invoke/mem_map while another thread drops the last map ref via mem_unmap or put_args), so success does not depend on conditions outside attacker control.\nPR:L - fastrpc_device_open performs no capability check, and on typical Qualcomm/Android deployments unprivileged/untrusted contexts can obtain access to the non-secure fastrpc node (directly or via HAL FD passing), so real root/init-namespace privileges are not required.\nUI:N - Exploitation requires only the attacker’s own open/ioctl calls on the fastrpc device; no separate victim action is needed.\nS:U - This is a kernel heap UAF enabling privilege escalation within the same OS security authority; it does not cross a VM, IOMMU, or other security-authority boundary.\nC:H - Use-after-free of struct fastrpc_map lets an attacker reclaim and control the freed object, enabling arbitrary kernel memory disclosure.\nI:H - The same UAF is exploitable for heap spraying and arbitrary write / control-flow hijacking in the kernel, not merely a limited corruption.\nA:H - Use-after-free of the map object can cause kernel oops/panic (and does so even when not fully exploited for code execution)."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T08:52:45.133Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18","versionEndExcluding":"6.1.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18","versionEndExcluding":"6.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2022-48874","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-09-10T16:05:19.392844Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-09-12T17:32:53.688Z"}}]}}}