{ "dataType": "CVE_RECORD", "dataVersion": "5.2", "cveMetadata": { "cveId": "CVE-2025-40028", "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "state": "PUBLISHED", "assignerShortName": "Linux", "dateReserved": "2025-04-16T07:20:57.152Z", "datePublished": "2025-10-28T09:32:35.681Z", "dateUpdated": "2026-08-05T12:07:10.905Z" }, "containers": { "cna": { "providerMetadata": { "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux", "dateUpdated": "2026-08-05T12:07:10.905Z" }, "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbinder: fix double-free in dbitmap\n\nA process might fail to allocate a new bitmap when trying to expand its\nproc->dmap. In that case, dbitmap_grow() fails and frees the old bitmap\nvia dbitmap_free(). However, the driver calls dbitmap_free() again when\nthe same process terminates, leading to a double-free error:\n\n ==================================================================\n BUG: KASAN: double-free in binder_proc_dec_tmpref+0x2e0/0x55c\n Free of addr ffff00000b7c1420 by task kworker/9:1/209\n\n CPU: 9 UID: 0 PID: 209 Comm: kworker/9:1 Not tainted 6.17.0-rc6-dirty #5 PREEMPT\n Hardware name: linux,dummy-virt (DT)\n Workqueue: events binder_deferred_func\n Call trace:\n kfree+0x164/0x31c\n binder_proc_dec_tmpref+0x2e0/0x55c\n binder_deferred_func+0xc24/0x1120\n process_one_work+0x520/0xba4\n [...]\n\n Allocated by task 448:\n __kmalloc_noprof+0x178/0x3c0\n bitmap_zalloc+0x24/0x30\n binder_open+0x14c/0xc10\n [...]\n\n Freed by task 449:\n kfree+0x184/0x31c\n binder_inc_ref_for_node+0xb44/0xe44\n binder_transaction+0x29b4/0x7fbc\n binder_thread_write+0x1708/0x442c\n binder_ioctl+0x1b50/0x2900\n [...]\n ==================================================================\n\nFix this issue by marking proc->map NULL in dbitmap_free()." } ], "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 bug is reached only through `ioctl()`/`write()` on a binder character device (`/dev/binder` or a binderfs device node), requiring a local process on the system. There is no remote or network-facing path into `binder_transaction()`.\nAC:L - The attacker fully controls both preconditions: the size of the failing `bitmap_zalloc()` (by creating hundreds of thousands of binder references so the doubling bitmap enters costly-order allocations that fail without invoking the OOM killer) and the memory pressure/fragmentation that makes it fail, then chooses exactly when the second free occurs by closing the fd. The window between the two frees is arbitrarily long, making heap grooming reliable.\nPR:L - Binder contains no `capable()` checks at all on this path; on Android every unprivileged app can open a binder device, and on distro kernels with CONFIG_ANDROID_BINDERFS an unprivileged user can mount binderfs inside a user namespace (`FS_USERNS_MOUNT`) and create devices without any capability. Only a basic local account is needed.\nUI:N - The attacking process performs everything itself — open the device, drive transactions to grow the bitmap, exhaust memory, then close the fd. No victim action is involved.\nS:U - The corruption is confined to the kernel's own heap/page allocator within the same security authority; there is no VM, IOMMU, or hypervisor boundary crossed.\nC:H - The double free lets the attacker reclaim the chunk with a chosen object and then have the kernel free it while still in use, producing a use-after-free with overlapping allocations that can be leveraged to read arbitrary kernel memory (credentials, keys, KASLR data).\nI:H - Freeing an in-use, attacker-sprayed object (or a costly-order page, giving cross-cache/physical-page reuse) yields a write primitive over kernel objects, enabling control-flow hijack and privilege escalation to root.\nA:H - Even unweaponized, the double free corrupts the SLUB freelist or page allocator and reliably panics the kernel (KASAN reports it as a `double-free` BUG), and the attacker can repeat it across many binder fds." } ] } ], "affected": [ { "product": "Linux", "vendor": "Linux", "defaultStatus": "unaffected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "drivers/android/dbitmap.h" ], "versions": [ { "version": "15d9da3f818cae676f822a04407d3c17b53357d2", "lessThan": "c301ec61ce6f16e21a36b99225ca8a20c1591e10", "status": "affected", "versionType": "git" }, { "version": "15d9da3f818cae676f822a04407d3c17b53357d2", "lessThan": "0390633979969c54c0ce6a198d6f45cdbe2c84b1", "status": "affected", "versionType": "git" }, { "version": "15d9da3f818cae676f822a04407d3c17b53357d2", "lessThan": "b781e5635a3398e2b64440371233c2c5102cd6cb", "status": "affected", "versionType": "git" }, { "version": "15d9da3f818cae676f822a04407d3c17b53357d2", "lessThan": "3ebcd3460cad351f198c39c6edb4af519a0ed934", "status": "affected", "versionType": "git" } ] }, { "product": "Linux", "vendor": "Linux", "defaultStatus": "affected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "drivers/android/dbitmap.h" ], "versions": [ { "version": "6.11", "status": "affected" }, { "version": "0", "lessThan": "6.11", "status": "unaffected", "versionType": "semver" }, { "version": "6.12.52", "lessThanOrEqual": "6.12.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.16.12", "lessThanOrEqual": "6.16.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.17.2", "lessThanOrEqual": "6.17.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.18", "lessThanOrEqual": "*", "status": "unaffected", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "operator": "OR", "negate": false, "cpeMatch": [ { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.11", "versionEndExcluding": "6.12.52" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.11", "versionEndExcluding": "6.16.12" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.11", "versionEndExcluding": "6.17.2" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.11", "versionEndExcluding": "6.18" } ] } ] } ], "references": [ { "url": "https://git.kernel.org/stable/c/c301ec61ce6f16e21a36b99225ca8a20c1591e10" }, { "url": "https://git.kernel.org/stable/c/0390633979969c54c0ce6a198d6f45cdbe2c84b1" }, { "url": "https://git.kernel.org/stable/c/b781e5635a3398e2b64440371233c2c5102cd6cb" }, { "url": "https://git.kernel.org/stable/c/3ebcd3460cad351f198c39c6edb4af519a0ed934" } ], "title": "binder: fix double-free in dbitmap", "x_generator": { "engine": "bippy-1.2.0" } } } }