CVE-2023-52609 binder: fix race between mmput() and do_exit()

Medium 4.7 Published Updated

A race condition in the Linux kernel binder driver can cause a denial of service by blocking cleanup tasks when a process exits unexpectedly.

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-2023-52609?

CVE-2023-52609 is a medium-severity vulnerability in Debian Debian Linux, published on 18 Mar 2024. 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:

binder: fix race between mmput() and do_exit()

Task A calls binder_update_page_range() to allocate and insert pages on a remote address space from Task B. For this, Task A pins the remote mm via mmget_not_zero() first. This can race with Task B do_exit() and the final mmput() refcount decrement will come from Task A.

Task A | Task B ------------------+------------------ mmget_not_zero() | | do_exit() | exit_mm() | mmput() mmput() | exit_mmap() | remove_vma() | fput() |

In this case, the work of ____fput() from Task B is queued up in Task A as TWA_RESUME. So in theory, Task A returns to userspace and the cleanup work gets executed. However, Task A instead sleep, waiting for a reply from Task B that never comes (it's dead).

This means the binder_deferred_release() is blocked until an unrelated binder event forces Task A to go back to userspace. All the associated death notifications will also be delayed until then.

In order to fix this use mmput_async() that will schedule the work in the corresponding mm->async_put_work WQ instead of Task A.

Weakness: CWE-362

Which versions are affected by CVE-2023-52609?

It affects 2 products.

Products include Debian Debian Linux, Linux kernel.

How do I fix CVE-2023-52609?

Apply the vendor's patch.

Is CVE-2023-52609 being exploited?

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

All Debian Debian Linux vulnerabilities

Sources

Also known as BELL-CVE-2023-52609, DEBIAN-CVE-2023-52609, GHSA-5h3h-5652-8xp5, UBUNTU-CVE-2023-52609.

Is CVE-2023-52609 in your software?

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

Check your SBOMs for free