CVE-2023-52609: binder: fix race between mmput() and do_exit()
In the Linux kernel, the following vulnerability has been resolved:
binder: fix race between mmput() and doexit()
Task A calls binderupdatepagerange() to allocate and insert pages on a remote address space from Task B. For this, Task A pins the remote mm via mmgetnotzero() first. This can race with Task B doexit() and the final mmput() refcount decrement will come from Task A.
Task A | Task B ------------------+------------------ mmgetnotzero() | | doexit() | exitmm() | mmput() mmput() | exitmmap() | removevma() | fput() |
In this case, the work of fput() from Task B is queued up in Task A as TWARESUME. 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 binderdeferredrelease() 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 mmputasync() that will schedule the work in the corresponding mm->asyncputwork WQ instead of Task A.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2023-52609?
CVE-2023-52609 is classified as a medium severity vulnerability affecting the Linux kernel.
How do I fix CVE-2023-52609?
To remediate CVE-2023-52609, update your Linux kernel to versions 5.10.223-1, 5.10.226-1, 6.1.123-1, 6.1.119-1, 6.12.11-1, or 6.12.12-1.
Is my system affected by CVE-2023-52609?
If you are running an affected version of the Linux kernel listed in the vulnerability, then your system is at risk for CVE-2023-52609.
What type of vulnerability is CVE-2023-52609?
CVE-2023-52609 is a race condition vulnerability related to memory management in the Linux kernel.
When was CVE-2023-52609 discovered?
CVE-2023-52609 was discovered and reported in 2023.