In the Linux kernel, the following vulnerability has been resolved:
RDMA/rxe: Fix race in do_task() when draining
When dotask() exhausts its iteration budget (!ret), it sets the state to TASKSTATEIDLE to reschedule, without a secondary check on the current task->state. This can overwrite the TASKSTATEDRAINING state set by a concurrent call to rxecleanuptask() or rxedisable_task().
While state changes are protected by a spinlock, both rxecleanuptask() and rxedisabletask() release the lock while waiting for the task to finish draining in the while(!isdone(task)) loop. The race occurs if dotask() hits its iteration limit and acquires the lock in this window. The cleanup logic may then proceed while the task incorrectly reschedules itself, leading to a potential use-after-free.
This bug was introduced during the migration from tasklets to workqueues, where the special handling for the draining case was lost.
Fix this by restoring the original pre-migration behavior. If the state is TASKSTATEDRAINING when iterations are exhausted, set cont to 1 to force a new loop iteration. This allows the task to finish its work, so that a subsequent iteration can reach the switch statement and correctly transition the state to TASKSTATEDRAINED, stopping the task as intended.
[
{
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@52edccfb555142678c836c285bf5b4ec760bd043",
"id": "CVE-2025-40061-2d15da14",
"digest": {
"function_hash": "159511708141818398770975757550958296545",
"length": 1358.0
},
"signature_type": "Function",
"target": {
"function": "do_task",
"file": "drivers/infiniband/sw/rxe/rxe_task.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@85288bcf7ffe11e7b036edf91937bc62fd384076",
"id": "CVE-2025-40061-4f39511b",
"digest": {
"line_hashes": [
"38639696703512155741117428239037888353",
"210131513442867607825083621431634185483",
"259408621248408115331150895188764595481",
"334046674798231703641404795019298899441",
"300693877699691293379733492322305006503"
],
"threshold": 0.9
},
"signature_type": "Line",
"target": {
"file": "drivers/infiniband/sw/rxe/rxe_task.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@660b6959c4170637f5db2279d1f71af33a49e49b",
"id": "CVE-2025-40061-5122cc0b",
"digest": {
"line_hashes": [
"38639696703512155741117428239037888353",
"210131513442867607825083621431634185483",
"259408621248408115331150895188764595481",
"334046674798231703641404795019298899441",
"300693877699691293379733492322305006503"
],
"threshold": 0.9
},
"signature_type": "Line",
"target": {
"file": "drivers/infiniband/sw/rxe/rxe_task.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@85288bcf7ffe11e7b036edf91937bc62fd384076",
"id": "CVE-2025-40061-5cc7a80c",
"digest": {
"function_hash": "159511708141818398770975757550958296545",
"length": 1358.0
},
"signature_type": "Function",
"target": {
"function": "do_task",
"file": "drivers/infiniband/sw/rxe/rxe_task.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8ca7eada62fcfabf6ec1dc7468941e791c1d8729",
"id": "CVE-2025-40061-6fea32a9",
"digest": {
"line_hashes": [
"38639696703512155741117428239037888353",
"210131513442867607825083621431634185483",
"259408621248408115331150895188764595481",
"334046674798231703641404795019298899441",
"300693877699691293379733492322305006503"
],
"threshold": 0.9
},
"signature_type": "Line",
"target": {
"file": "drivers/infiniband/sw/rxe/rxe_task.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8ca7eada62fcfabf6ec1dc7468941e791c1d8729",
"id": "CVE-2025-40061-8d29030d",
"digest": {
"function_hash": "159511708141818398770975757550958296545",
"length": 1358.0
},
"signature_type": "Function",
"target": {
"function": "do_task",
"file": "drivers/infiniband/sw/rxe/rxe_task.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@52edccfb555142678c836c285bf5b4ec760bd043",
"id": "CVE-2025-40061-ba042557",
"digest": {
"line_hashes": [
"38639696703512155741117428239037888353",
"210131513442867607825083621431634185483",
"259408621248408115331150895188764595481",
"334046674798231703641404795019298899441",
"300693877699691293379733492322305006503"
],
"threshold": 0.9
},
"signature_type": "Line",
"target": {
"file": "drivers/infiniband/sw/rxe/rxe_task.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@660b6959c4170637f5db2279d1f71af33a49e49b",
"id": "CVE-2025-40061-bba7b199",
"digest": {
"function_hash": "159511708141818398770975757550958296545",
"length": 1358.0
},
"signature_type": "Function",
"target": {
"function": "do_task",
"file": "drivers/infiniband/sw/rxe/rxe_task.c"
}
}
]