# CVE-2023-54157: binder: fix UAF of alloc-\>vma in race with munmap()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.23% (percentile 8, 2026-11-26)
- **Published:** 2025-12-24T13:07:06.764Z
- **Modified:** 2026-08-05T09:17:43.435Z

## Who should check

- Anyone running Linux \>= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, \< 1bb8a65190d45cd5c7dbc85e29b9102110cd6be6; \>= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, \< 931ea1ed31be939c1efdbc49bc66d2a45684f9b4; \>= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, \< ca0cc0a9c6e56c699e2acbb93d8024523021f3c3; \>= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, \< d1d8875c8c13517f6fd1ff8d4d3e1ac366a17e07
- Anyone running Linux 4.20

## Description

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

binder: fix UAF of alloc-\>vma in race with munmap()

\[ cmllamas: clean forward port from commit 015ac18be7de ("binder: fix
  UAF of alloc-\>vma in race with munmap()") in 5.10 stable. It is needed
  in mainline after the revert of commit a43cfc87caaf ("android: binder:
  stop saving a pointer to the VMA") as pointed out by Liam. The commit
  log and tags have been tweaked to reflect this. \]

In commit 720c24192404 ("ANDROID: binder: change down\_write to
down\_read") binder assumed the mmap read lock is sufficient to protect
alloc-\>vma inside binder\_update\_page\_range(). This used to be accurate
until commit dd2283f2605e ("mm: mmap: zap pages with read mmap\_sem in
munmap"), which now downgrades the mmap\_lock after detaching the vma
from the rbtree in munmap(). Then it proceeds to teardown and free the
vma with only the read lock held.

This means that accesses to alloc-\>vma in binder\_update\_page\_range() now
will race with vm\_area\_free() in munmap() and can cause a UAF as shown
in the following KASAN trace:

  ==================================================================
  BUG: KASAN: use-after-free in vm\_insert\_page+0x7c/0x1f0
  Read of size 8 at addr ffff16204ad00600 by task server/558

  CPU: 3 PID: 558 Comm: server Not tainted 5.10.150-00001-gdc8dcf942daa \#1
  Hardware name: linux,dummy-virt (DT)
  Call trace:
   dump\_backtrace+0x0/0x2a0
   show\_stack+0x18/0x2c
   dump\_stack+0xf8/0x164
   print\_address\_description.constprop.0+0x9c/0x538
   kasan\_report+0x120/0x200
   \_\_asan\_load8+0xa0/0xc4
   vm\_insert\_page+0x7c/0x1f0
   binder\_update\_page\_range+0x278/0x50c
   binder\_alloc\_new\_buf+0x3f0/0xba0
   binder\_transaction+0x64c/0x3040
   binder\_thread\_write+0x924/0x2020
   binder\_ioctl+0x1610/0x2e5c
   \_\_arm64\_sys\_ioctl+0xd4/0x120
   el0\_svc\_common.constprop.0+0xac/0x270
   do\_el0\_svc+0x38/0xa0
   el0\_svc+0x1c/0x2c
   el0\_sync\_handler+0xe8/0x114
   el0\_sync+0x180/0x1c0

  Allocated by task 559:
   kasan\_save\_stack+0x38/0x6c
   \_\_kasan\_kmalloc.constprop.0+0xe4/0xf0
   kasan\_slab\_alloc+0x18/0x2c
   kmem\_cache\_alloc+0x1b0/0x2d0
   vm\_area\_alloc+0x28/0x94
   mmap\_region+0x378/0x920
   do\_mmap+0x3f0/0x600
   vm\_mmap\_pgoff+0x150/0x17c
   ksys\_mmap\_pgoff+0x284/0x2dc
   \_\_arm64\_sys\_mmap+0x84/0xa4
   el0\_svc\_common.constprop.0+0xac/0x270
   do\_el0\_svc+0x38/0xa0
   el0\_svc+0x1c/0x2c
   el0\_sync\_handler+0xe8/0x114
   el0\_sync+0x180/0x1c0

  Freed by task 560:
   kasan\_save\_stack+0x38/0x6c
   kasan\_set\_track+0x28/0x40
   kasan\_set\_free\_info+0x24/0x4c
   \_\_kasan\_slab\_free+0x100/0x164
   kasan\_slab\_free+0x14/0x20
   kmem\_cache\_free+0xc4/0x34c
   vm\_area\_free+0x1c/0x2c
   remove\_vma+0x7c/0x94
   \_\_do\_munmap+0x358/0x710
   \_\_vm\_munmap+0xbc/0x130
   \_\_arm64\_sys\_munmap+0x4c/0x64
   el0\_svc\_common.constprop.0+0xac/0x270
   do\_el0\_svc+0x38/0xa0
   el0\_svc+0x1c/0x2c
   el0\_sync\_handler+0xe8/0x114
   el0\_sync+0x180/0x1c0

  \[...\]
  ==================================================================

To prevent the race above, revert back to taking the mmap write lock
inside binder\_update\_page\_range(). One might expect an increase of mmap
lock contention. However, binder already serializes these calls via top
level alloc-\>mutex. Also, there was no performance impact shown when
running the binder benchmark tests.

## Affected and fixed versions

- Linux: \>= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, \< 1bb8a65190d45cd5c7dbc85e29b9102110cd6be6; \>= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, \< 931ea1ed31be939c1efdbc49bc66d2a45684f9b4; \>= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, \< ca0cc0a9c6e56c699e2acbb93d8024523021f3c3; \>= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, \< d1d8875c8c13517f6fd1ff8d4d3e1ac366a17e07 (cvelist)
- Linux: 4.20 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-54157. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-54157.md
Affected: Linux >= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, < 1bb8a65190d45cd5c7dbc85e29b9102110cd6be6; >= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, < 931ea1ed31be939c1efdbc49bc66d2a45684f9b4; >= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, < ca0cc0a9c6e56c699e2acbb93d8024523021f3c3; >= dd2283f2605e3b3e9c61bca…
Fixed in: Linux 1bb8a65190d45cd5c7dbc85e29b9102110cd6be6, Linux 931ea1ed31be939c1efdbc49bc66d2a45684f9b4

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-54157 being exploited?

There is no confirmed exploitation: CVE-2023-54157 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.23% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-54157?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-54157?

Linux \>= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, \< 1bb8a65190d45cd5c7dbc85e29b9102110cd6be6; \>= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, \< 931ea1ed31be939c1efdbc49bc66d2a45684f9b4; \>= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, \< ca0cc0a9c6e56c699e2acbb93d8024523021f3c3; \>= dd2283f2605e3b3e9c61bcae844b34f2afa4813f, \< d1d8875c8c13517f6fd1ff8d4d3e1ac366a17e07; Linux 4.20.

### Is there a fix for CVE-2023-54157?

Yes. Fixed in Linux 1bb8a65190d45cd5c7dbc85e29b9102110cd6be6, Linux 931ea1ed31be939c1efdbc49bc66d2a45684f9b4. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-54157?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/1bb8a65190d45cd5c7dbc85e29b9102110cd6be6>
- other: <https://git.kernel.org/stable/c/931ea1ed31be939c1efdbc49bc66d2a45684f9b4>
- other: <https://git.kernel.org/stable/c/ca0cc0a9c6e56c699e2acbb93d8024523021f3c3>
- other: <https://git.kernel.org/stable/c/d1d8875c8c13517f6fd1ff8d4d3e1ac366a17e07>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-54157>

HTML: <https://flawdb.com/CVE-2023-54157> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-54157>
