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.
[
{
"id": "CVE-2025-39977-16bb0a39",
"deprecated": false,
"target": {
"function": "requeue_pi_wake_futex",
"file": "kernel/futex/requeue.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d824b2dbdcfe3c390278dd9652ea526168ef6850",
"digest": {
"length": 351.0,
"function_hash": "79293099083029529895252991215709074157"
},
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2025-39977-6917c837",
"deprecated": false,
"target": {
"file": "kernel/futex/requeue.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cb5d19a61274b51b49601214a87af573b43d60fa",
"digest": {
"line_hashes": [
"160213375841278904612831132543741570845",
"228504553634408485002406459562692114129",
"80898422298175794301024613479299516607",
"277418175906165590123758266307717146104",
"119383389621903115740750415748012411947",
"273360076791450319684836368070150166545",
"80015738351317566738820245627168470032",
"339075914011019731959836251670738073471",
"295626471960879843613400460783735163366",
"242468682264243299749163247838621798631"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2025-39977-76d5b40e",
"deprecated": false,
"target": {
"file": "kernel/futex/requeue.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d824b2dbdcfe3c390278dd9652ea526168ef6850",
"digest": {
"line_hashes": [
"160213375841278904612831132543741570845",
"228504553634408485002406459562692114129",
"80898422298175794301024613479299516607",
"277418175906165590123758266307717146104",
"334285480943938167583713032450922375393",
"330046207925245700519682419748353699138",
"1036084545073754887403113089404087048",
"339075914011019731959836251670738073471",
"295626471960879843613400460783735163366",
"242468682264243299749163247838621798631"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2025-39977-77b6347c",
"deprecated": false,
"target": {
"function": "requeue_pi_wake_futex",
"file": "kernel/futex/requeue.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a170b9c0dde83312b8b58ccc91509c7c15711641",
"digest": {
"length": 300.0,
"function_hash": "20594351922312143593715492055036795886"
},
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2025-39977-8b71d60d",
"deprecated": false,
"target": {
"file": "kernel/futex/requeue.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a170b9c0dde83312b8b58ccc91509c7c15711641",
"digest": {
"line_hashes": [
"160213375841278904612831132543741570845",
"228504553634408485002406459562692114129",
"80898422298175794301024613479299516607",
"277418175906165590123758266307717146104",
"119383389621903115740750415748012411947",
"273360076791450319684836368070150166545",
"80015738351317566738820245627168470032",
"339075914011019731959836251670738073471",
"295626471960879843613400460783735163366",
"242468682264243299749163247838621798631"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2025-39977-ab24dbee",
"deprecated": false,
"target": {
"file": "kernel/futex/requeue.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@348736955ed6ca6e99ca24b93b1d3fbfe352c181",
"digest": {
"line_hashes": [
"160213375841278904612831132543741570845",
"228504553634408485002406459562692114129",
"80898422298175794301024613479299516607",
"277418175906165590123758266307717146104",
"119383389621903115740750415748012411947",
"273360076791450319684836368070150166545",
"80015738351317566738820245627168470032",
"339075914011019731959836251670738073471",
"295626471960879843613400460783735163366",
"242468682264243299749163247838621798631"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2025-39977-cff41d8b",
"deprecated": false,
"target": {
"function": "requeue_pi_wake_futex",
"file": "kernel/futex/requeue.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b549113738e8c751b613118032a724b772aa83f2",
"digest": {
"length": 351.0,
"function_hash": "79293099083029529895252991215709074157"
},
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2025-39977-db1b29b8",
"deprecated": false,
"target": {
"function": "requeue_pi_wake_futex",
"file": "kernel/futex/requeue.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cb5d19a61274b51b49601214a87af573b43d60fa",
"digest": {
"length": 300.0,
"function_hash": "20594351922312143593715492055036795886"
},
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2025-39977-e60cc3de",
"deprecated": false,
"target": {
"file": "kernel/futex/requeue.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b549113738e8c751b613118032a724b772aa83f2",
"digest": {
"line_hashes": [
"160213375841278904612831132543741570845",
"228504553634408485002406459562692114129",
"80898422298175794301024613479299516607",
"277418175906165590123758266307717146104",
"334285480943938167583713032450922375393",
"330046207925245700519682419748353699138",
"1036084545073754887403113089404087048",
"339075914011019731959836251670738073471",
"295626471960879843613400460783735163366",
"242468682264243299749163247838621798631"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2025-39977-ec4c4a14",
"deprecated": false,
"target": {
"function": "requeue_pi_wake_futex",
"file": "kernel/futex/requeue.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@348736955ed6ca6e99ca24b93b1d3fbfe352c181",
"digest": {
"length": 300.0,
"function_hash": "20594351922312143593715492055036795886"
},
"signature_version": "v1",
"signature_type": "Function"
}
]