futex: Prevent use-after-free during requeue-PI
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 futex_wait_requeue_pi() futex_do_wait() schedule() futex_requeue() futex_proxy_trylock_atomic() futex_requeue_pi_prepare() requeue_pi_wake_futex() futex_requeue_pi_complete() /* preempt */ * timeout/ signal wakes T1 * futex_requeue_pi_wakeup_sync() // Q_REQUEUE_PI_LOCKED futex_hash_put() // back to userland, on stack futex_q is garbage /* back */ wake_up_state(q->task, TASK_NORMAL); In this scenario futex_wait_requeue_pi() is able to leave without using futex_q::lock_ptr for synchronization. This can be prevented by reading futex_q::task before updating the futex_q::requeue_state. A reference on the task_struct is not needed because requeue_pi_wake_futex() is invoked with a spinlock_t held which implies a RCU read section. Even if T1 terminates immediately after, the task_struct will remain valid during T2's wake_up_state(). A READ_ONCE on futex_q::task before futex_requeue_pi_complete() 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.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.1.155, 6.12.50, 6.16.10, 6.6.109
- CVEs
- CVE-2025-39977
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 15:57 UTC · Revision 1
Source evidence
futex: Prevent use-after-free during requeue-PI
core-osv · Original sourcePublished 15 Oct 2025, 07:55 UTC
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 futex_wait_requeue_pi() futex_do_wait() schedule() futex_requeue() futex_proxy_trylock_atomic() futex_requeue_pi_prepare() requeue_pi_wake_futex() futex_requeue_pi_complete() /* preempt */ * timeout/ signal wakes T1 * futex_requeue_pi_wakeup_sync() // Q_REQUEUE_PI_LOCKED futex_hash_put() // back to userland, on stack futex_q is garbage /* back */ wake_up_state(q->task, TASK_NORMAL); In this scenario futex_wait_requeue_pi() is able to leave without using futex_q::lock_ptr for synchronization. This can be prevented by reading futex_q::task before updating the futex_q::requeue_state. A reference on the task_struct is not needed because requeue_pi_wake_futex() is invoked with a spinlock_t held which implies a RCU read section. Even if T1 terminates immediately after, the task_struct will remain valid during T2's wake_up_state(). A READ_ONCE on futex_q::task before futex_requeue_pi_complete() 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.
osv:CVE-2025-39977
Kernel
Fixed versions: 6.1.155, 6.6.109, 6.12.50, 6.16.10
Complete source record
{
"id": "84e021687ab2867f97f1baf3db995c6a1b2d95244c42a478ba0f272f8dbf7322",
"url": "https://osv.dev/vulnerability/CVE-2025-39977",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "futex: Prevent use-after-free during requeue-PI",
"summary": "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 futex_wait_requeue_pi() futex_do_wait() schedule() futex_requeue() futex_proxy_trylock_atomic() futex_requeue_pi_prepare() requeue_pi_wake_futex() futex_requeue_pi_complete() /* preempt */ * timeout/ signal wakes T1 * futex_requeue_pi_wakeup_sync() // Q_REQUEUE_PI_LOCKED futex_hash_put() // back to userland, on stack futex_q is garbage /* back */ wake_up_state(q->task, TASK_NORMAL); In this scenario futex_wait_requeue_pi() is able to leave without using futex_q::lock_ptr for synchronization. This can be prevented by reading futex_q::task before updating the futex_q::requeue_state. A reference on the task_struct is not needed because requeue_pi_wake_futex() is invoked with a spinlock_t held which implies a RCU read section. Even if T1 terminates immediately after, the task_struct will remain valid during T2's wake_up_state(). A READ_ONCE on futex_q::task before futex_requeue_pi_complete() 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.",
"evidence": "osv:CVE-2025-39977",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.1.155",
"evidence": "/affected/1/ranges"
},
{
"value": "6.6.109",
"evidence": "/affected/1/ranges"
},
{
"value": "6.12.50",
"evidence": "/affected/1/ranges"
},
{
"value": "6.16.10",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "CVE-2025-39977",
"aliases": [
"CVE-2025-39977"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "07d91ef510fb16a2e0ca7453222105835b7ba3b8"
},
{
"fixed": "cb5d19a61274b51b49601214a87af573b43d60fa"
},
{
"fixed": "348736955ed6ca6e99ca24b93b1d3fbfe352c181"
},
{
"fixed": "a170b9c0dde83312b8b58ccc91509c7c15711641"
},
{
"fixed": "d824b2dbdcfe3c390278dd9652ea526168ef6850"
},
{
"fixed": "b549113738e8c751b613118032a724b772aa83f2"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-39977.json"
}
},
{
"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"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-39977.json"
}
}
],
"modified": "2026-10-28T02:30:36.903235038Z",
"provider": "osv",
"references": [
"https://cert-portal.siemens.com/productcert/html/ssa-019113.html",
"https://cert-portal.siemens.com/productcert/html/ssa-082556.html",
"https://cert-portal.siemens.com/productcert/html/ssa-457936.html",
"https://git.kernel.org/stable/c/348736955ed6ca6e99ca24b93b1d3fbfe352c181",
"https://git.kernel.org/stable/c/a170b9c0dde83312b8b58ccc91509c7c15711641",
"https://git.kernel.org/stable/c/b549113738e8c751b613118032a724b772aa83f2",
"https://git.kernel.org/stable/c/cb5d19a61274b51b49601214a87af573b43d60fa",
"https://git.kernel.org/stable/c/d824b2dbdcfe3c390278dd9652ea526168ef6850",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39977.json",
"https://nvd.nist.gov/vuln/detail/CVE-2025-39977",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39977.json"
}
},
"related_cves": [
{
"value": "CVE-2025-39977",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 504371,
"published_at": "2025-10-15T07:55:58.283+00:00"
}