CVE-2023-54157
published high CVSS 3.1 · 7.8binder: fix UAF of alloc->vma in race with munmap()
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linuxdd2283f2605e3b3e9c61bcae844b34f2afa4813f to < 1bb8a65190d45cd5c7dbc85e29b9102110cd6be6 · dd2283f2605e3b3e9c61bcae844b34f2afa4813f to < 931ea1ed31be939c1efdbc49bc66d2a45684f9b4 · dd2283f2605e3b3e9c61bcae844b34f2afa4813f to < ca0cc0a9c6e56c699e2acbb93d8024523021f3c3 · dd2283f2605e3b3e9c61bcae844b34f2afa4813f to < d1d8875c8c13517f6fd1ff8d4d3e1ac366a17e07 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux4.20 (affected) · 0 to < 4.20 (unaffected · semver) · 5.15.115 through 5.15.* (unaffected · semver) · 6.1.31 through 6.1.* (unaffected · semver) · 6.3.5 through 6.3.* (unaffected · semver) · 6.4 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2 | Release evaluationALAS2KERNEL-5.10-2022-023 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2 | Release evaluationALAS2KERNEL-5.15-2023-021 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2 | Release evaluationALAS2KERNEL-5.4-2022-039 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2 | kernelaarch64 | Listed in advisory | Not stated | ALAS2KERNEL-5.10-2022-023 |
| Amazon Linux | AL2 | kernelaarch64 | Listed in advisory | Not stated | ALAS2KERNEL-5.15-2023-021 |
Show 15 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluationALAS2023-2023-228 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2 | kernelaarch64 | Listed in advisory | Not stated | ALAS2KERNEL-5.4-2022-039 |
| Amazon Linux | AL2 | kerneli686 | Listed in advisory | Not stated | ALAS2KERNEL-5.10-2022-023 |
| Amazon Linux | AL2 | kerneli686 | Listed in advisory | Not stated | ALAS2KERNEL-5.15-2023-021 |
| Amazon Linux | AL2 | kerneli686 | Listed in advisory | Not stated | ALAS2KERNEL-5.4-2022-039 |
| Amazon Linux | AL2 | kernelsrc | Listed in advisory | Not stated | ALAS2KERNEL-5.10-2022-023 |
| Amazon Linux | AL2 | kernelsrc | Listed in advisory | Not stated | ALAS2KERNEL-5.15-2023-021 |
| Amazon Linux | AL2 | kernelsrc | Listed in advisory | Not stated | ALAS2KERNEL-5.4-2022-039 |
| Amazon Linux | AL2 | kernelx86_64 | Listed in advisory | Not stated | ALAS2KERNEL-5.10-2022-023 |
| Amazon Linux | AL2 | kernelx86_64 | Listed in advisory | Not stated | ALAS2KERNEL-5.15-2023-021 |
| Amazon Linux | AL2 | kernelx86_64 | Listed in advisory | Not stated | ALAS2KERNEL-5.4-2022-039 |
| Amazon Linux | AL2023 | kernelaarch64 | Listed in advisory | Not stated | ALAS2023-2023-228 |
| Amazon Linux | AL2023 | kernelsrc | Listed in advisory | Not stated | ALAS2023-2023-228 |
| Amazon Linux | AL2023 | kernelx86_64 | Listed in advisory | Not stated | ALAS2023-2023-228 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The vulnerability is reached only through local syscalls — `mmap()`, `munmap()`, and `ioctl(BINDER_WRITE_READ)` on an opened `/dev/binder` (or binderfs) character device. There is no remote or adjacent-network path into `binder_update_page_range()`. AC:L - The attacker controls both sides of the race entirely within their own process: one thread issues the BC_TRANSACTION ioctl while a second thread calls `munmap()` on the binder mapping. The window is further widened by the sleepable `alloc_page(GFP_KERNEL)` that executes between the `alloc->vma` load and the `vm_insert_page()` dereference, and the attempt is freely repeatable. PR:L - No capability check exists anywhere on the path — binder.c contains no `capable()`/`CAP_*` gate reaching `binder_alloc_new_buf()`. An ordinary Android app (`untrusted_app`) may open `/dev/binder`, and on generic kernels binderfs is `FS_USERNS_MOUNT` (binderfs.c:796), so an unprivileged user can `unshare -Ur`, mount binderfs, and create a 0600 binder device they own via `BINDER_CTL_ADD`. UI:N - The attacker performs every step — open, mmap, transaction ioctl, and munmap — from their own process with no victim action required. S:U - The corruption occurs in kernel memory and yields local privilege escalation within the same security authority; no VM, IOMMU, or sandbox boundary is crossed by the flaw itself. C:H - This is a use-after-free of a `struct vm_area_struct` from the global `vm_area_cachep`, which an attacker reclaims trivially with a concurrent `mmap()`, gaining control of `vm_start/vm_end`, `vm_mm`, and `vm_page_prot`. `vm_insert_page()` then maps attacker-held binder pages into an unintended (potentially cross-process) mapping, enabling disclosure of memory beyond the attacker's own address space. I:H - The UAF is not read-only — `vm_insert_page()` performs `vm_flags_set(vma, VM_MIXEDMAP)`, writing into the freed/reclaimed slab object, and then installs page-table entries derived from its attacker-controllable fields. This yields a page-mapping and heap-corruption primitive of the same class as previously weaponized binder UAFs used for Android root escalation. A:H - The KASAN report in the fix commit shows a use-after-free read in `vm_insert_page()` reachable from a normal binder ioctl, and unsuccessful exploitation attempts corrupt page tables or the freed slab object, causing an oops or panic. The attacker can retrigger the race repeatedly.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | dd2283f2605e3b3e9c61bcae844b34f2afa4813f to < 1bb8a65190d45cd5c7dbc85e29b9102110cd6be6 (affected · git)dd2283f2605e3b3e9c61bcae844b34f2afa4813f to < 931ea1ed31be939c1efdbc49bc66d2a45684f9b4 (affected · git)dd2283f2605e3b3e9c61bcae844b34f2afa4813f to < ca0cc0a9c6e56c699e2acbb93d8024523021f3c3 (affected · git)dd2283f2605e3b3e9c61bcae844b34f2afa4813f to < d1d8875c8c13517f6fd1ff8d4d3e1ac366a17e07 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 4.20 (affected)0 to < 4.20 (unaffected · semver)5.15.115 through 5.15.* (unaffected · semver)6.1.31 through 6.1.* (unaffected · semver)6.3.5 through 6.3.* (unaffected · semver)6.4 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
4Provider assertions
1Linux · cna
binder: fix UAF of alloc->vma in race with munmap()
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 5002be22037588d8e6b5ef40613b17efc6cf85a33e8d6cc0c993234c48259453
- Ingested
- 23 Sep 2026, 08:15:07 UTC
- Source record
- Official CVE record