CVE-2025-39977

Source
https://cve.org/CVERecord?id=CVE-2025-39977
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-39977.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-39977
Downstream
Related
Published
2025-10-15T07:55:58.283Z
Modified
2026-03-20T12:43:07.914557Z
Summary
futex: Prevent use-after-free during requeue-PI
Details

In the Linux kernel, the following vulnerability has been resolved:

futex: Prevent use-after-free during requeue-PI

syzbot managed to trigger the following race:

T1 T2

futexwaitrequeuepi() futexdowait() schedule() futexrequeue() futexproxytrylockatomic() futexrequeuepiprepare() requeuepiwakefutex() futexrequeuepicomplete() /* preempt */

     * timeout/ signal wakes T1 *

futexrequeuepiwakeupsync() // QREQUEUEPILOCKED futexhashput() // back to userland, on stack futexq is garbage

                                  /* back */
                                 wake_up_state(q->task, TASK_NORMAL);

In this scenario futexwaitrequeuepi() is able to leave without using futexq::lock_ptr for synchronization.

This can be prevented by reading futexq::task before updating the futexq::requeuestate. A reference on the taskstruct is not needed because requeuepiwakefutex() is invoked with a spinlockt held which implies a RCU read section.

Even if T1 terminates immediately after, the taskstruct will remain valid during T2's wakeupstate(). A READONCE on futexq::task before futexrequeuepicomplete() is enough because it ensures that the variable is read before the state is updated.

Read futex_q::task before updating the requeue state, use it for the following wakeup.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39977.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
07d91ef510fb16a2e0ca7453222105835b7ba3b8
Fixed
cb5d19a61274b51b49601214a87af573b43d60fa
Fixed
348736955ed6ca6e99ca24b93b1d3fbfe352c181
Fixed
a170b9c0dde83312b8b58ccc91509c7c15711641
Fixed
d824b2dbdcfe3c390278dd9652ea526168ef6850
Fixed
b549113738e8c751b613118032a724b772aa83f2

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-39977.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.15.0
Fixed
6.1.155
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.109
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.50
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.16.10

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-39977.json"