nday
CVE-2023-54157

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

Linux / Linux

Divulgation : . nday n’a encore aucune trace de correctif ; cela ne veut pas dire qu’il n’en existe pas. Cette vulnérabilité ne figure dans aucune des quatre sources de PoC. Aucune inscription au catalogue KEV de la CISA à ce jour.

why these tags

nday derives these tags by fixed rules from the facts below; NVD, the CNA and other sources do not assign them. Vocabulary and rules: ~/tags.

local
AV:L in CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (CVSS 3.1) from the CNA Linux
no user interaction
UI:N in CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (CVSS 3.1) from the CNA Linux
Linux kernel
affected products in the CVE record: Linux · Linux
operating system
affected products in the CVE record: Linux · Linuxthe product type of Linux kernel in nday's product registry
étape actuelle
DIS
divulgation
CVSS
7.8 HIGH v3.1

Cycle de vie

Axe en UTC ; point = minute exacte, barre large = date seule, creux = inconnue ou déduite.
date inconnue
DISdivulguée
2025-12-24T13:07Z
PATcorrectif
aucune donnée
ANAanalyse
aucune donnée
POCPoC
aucune donnée
ITWexploitée
aucune donnée
KEVKEV
aucune donnée

Résumé

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.

Original text of the CVE record (cvelist), shown as published.

Exploit conditions

What an attack needs, read from the CVSS vector.
Attack vector AV:L
Local: needs a local or SSH session, or a user tricked into acting on the machine
Attack complexity AC:L
Low: no special conditions; the attacker can expect repeatable success
Privileges required PR:L
Low: ordinary user privileges
User interaction UI:N
None: no action by anyone other than the attacker

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

CVSS 3.1 vector from the CVE record, scored by the CNA Linux.

Journal des événements

+DISdivulgation

Fiche CVE publiée par Linux. CVSS 7.8, gravité élevée.

source cvelist · importé en masse par nday le · brut
{
  "id": 310252,
  "type": "disclosed",
  "source": "cvelist",
  "url": "https://www.cve.org/CVERecord?id=CVE-2023-54157",
  "occurred_at": "2025-12-24T13:07:06.764Z",
  "observed_at": "2026-11-13T05:38:14.046808Z",
  "is_backfill": true,
  "dedupe_key": "",
  "detail": {
    "cvss": {
      "source": "cna",
      "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "version": "3.1",
      "base_score": 7.8,
      "base_severity": "HIGH"
    },
    "state": "PUBLISHED",
    "date_published": "2025-12-24T13:07:06.764Z",
    "assigner_short_name": "Linux"
  }
}

Report an error

report an error or omission

Something on this page wrong or missing? Tell the editors; if they accept it, this page's revision log says so publicly. Upstream data is not changed.

Échanges entre chercheurs

0 chercheur en a parlé ces 7 derniers jours

Publications sur X de chercheurs suivis par nday citant cette CVE, telles que publiées. nday ne les vérifie pas.

nday n’a encore recueilli aucune publication sur X d’un chercheur de sa liste citant cette CVE.

Discussion

0 comments

No comments yet.