android: binder: stop saving a pointer to the VMA
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ dd2283f2605e3b3e9c61bcae844b34f2afa4813f · < a43cfc87caaf46710c8027a8c23b8a55f1078f19| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
android: binder: stop saving a pointer to the VMA
Do not record a pointer to a VMA outside of the mmap_lock for later use. This is unsafe and there are a number of failure paths *after* the recorded VMA pointer may be freed during setup. There is no callback to the driver to clear the saved pointer from generic mm code. Furthermore, the VMA pointer may become stale if any number of VMA operations end up freeing the VMA so saving it was fragile to being with.
Instead, change the binder_alloc struct to record the start address of the VMA and use vma_lookup() to get the vma when needed. Add lockdep mmap_lock checks on updates to the vma pointer to ensure the lock is held and depend on that lock for synchronization of readers and writers - which was already the case anyways, so the smp_wmb()/smp_rmb() was not necessary.
[akpm@linux-foundation.org: fix drivers/android/binder_alloc_selftest.c]
From the CVE record · Linux
The Linux kernel’s Android Binder allocator can retain a pointer to a VMA after it has been freed. This can cause a use-after-free during setup or later VMA operations. The input does not specify whether exploitation requires local access, authentication, or user interaction.
Engineers running Linux kernels with the Android Binder allocator should check their kernel versions; affected versions are not specified.