CVE-2022-50240 android: binder: stop saving a pointer to the VMA

High 7.8 Published Updated

A use-after-free vulnerability in the Linux kernel's binder driver allows attackers to potentially execute code or escalate privileges by exploiting stale VMA pointers.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2022-50240?

CVE-2022-50240 is a high-severity use after free vulnerability in Linux kernel, published on 15 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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.

[[email protected]: fix drivers/android/binder_alloc_selftest.c]

Weakness: CWE-416

Which versions are affected by CVE-2022-50240?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-50240?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2022-50240 being exploited?

There is no known exploitation of CVE-2022-50240 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-50240, GHSA-4cpm-89f2-8grm, ROOT-OS-UBUNTU-2204-CVE-2022-50240, ROOT-OS-UBUNTU-2404-CVE-2022-50240, UBUNTU-CVE-2022-50240.

Is CVE-2022-50240 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free