Linux hwe edge: In the Linux kernel, the following vulnerability has been resolved: RDMA/rxe: Fix race in do_task() when draining When do_task() exhausts its… (CVE-2025-40061)
In the Linux kernel, the following vulnerability has been resolved: RDMA/rxe: Fix race in do_task() when draining When do_task() exhausts its iteration budget (!ret), it sets the state to TASK_STATE_IDLE to reschedule, without a secondary check on the current task->state. This can overwrite the TASK_STATE_DRAINING state set by a concurrent call to rxe_cleanup_task() or rxe_disable_task(). While state changes are protected by a spinlock, both rxe_cleanup_task() and rxe_disable_task() release the lock while waiting for the task to finish draining in the while(!is_done(task)) loop. The race occurs if do_task() 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 TASK_STATE_DRAINING 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 TASK_STATE_DRAINED, stopping the task as intended.
AI Analysis
Technical Summary
CVE-2025-40061 is a race condition vulnerability in the Linux kernel's RDMA/rxe driver. When do_task() exhausts its iteration budget, it sets the task state to TASK_STATE_IDLE without verifying if the task is currently in TASK_STATE_DRAINING, which can be set by concurrent calls to rxe_cleanup_task() or rxe_disable_task(). Although state changes are protected by a spinlock, these cleanup functions release the lock while waiting for the task to drain, creating a race window. If do_task() reacquires the lock during this window, it may incorrectly reschedule the task, leading to a use-after-free scenario. The vulnerability was introduced during a migration from tasklets to workqueues, losing special handling for draining tasks. The fix reinstates the original behavior by forcing a continuation loop iteration when the state is TASK_STATE_DRAINING, ensuring the task finishes draining and transitions to TASK_STATE_DRAINED properly.
Potential Impact
Successful exploitation can lead to a use-after-free condition in the Linux kernel's RDMA/rxe driver, potentially allowing an attacker with local privileges to cause memory corruption. This can result in system instability, denial of service, or escalation of privileges due to the high impact on confidentiality, integrity, and availability as indicated by the CVSS vector.
Mitigation Recommendations
A fix for this vulnerability has been implemented in the Linux kernel by restoring the original pre-migration behavior in the do_task() function. Users should apply the official kernel updates that include this fix once available. Since no explicit patch links or vendor advisories are provided, check the Linux kernel vendor advisories or distribution security updates for the official patch and apply it promptly.
Linux hwe edge: In the Linux kernel, the following vulnerability has been resolved: RDMA/rxe: Fix race in do_task() when draining When do_task() exhausts its… (CVE-2025-40061)
Description
In the Linux kernel, the following vulnerability has been resolved: RDMA/rxe: Fix race in do_task() when draining When do_task() exhausts its iteration budget (!ret), it sets the state to TASK_STATE_IDLE to reschedule, without a secondary check on the current task->state. This can overwrite the TASK_STATE_DRAINING state set by a concurrent call to rxe_cleanup_task() or rxe_disable_task(). While state changes are protected by a spinlock, both rxe_cleanup_task() and rxe_disable_task() release the lock while waiting for the task to finish draining in the while(!is_done(task)) loop. The race occurs if do_task() 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 TASK_STATE_DRAINING 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 TASK_STATE_DRAINED, stopping the task as intended.
CVSS v3.1
Score 7.8high
Affected software
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2025-40061 is a race condition vulnerability in the Linux kernel's RDMA/rxe driver. When do_task() exhausts its iteration budget, it sets the task state to TASK_STATE_IDLE without verifying if the task is currently in TASK_STATE_DRAINING, which can be set by concurrent calls to rxe_cleanup_task() or rxe_disable_task(). Although state changes are protected by a spinlock, these cleanup functions release the lock while waiting for the task to drain, creating a race window. If do_task() reacquires the lock during this window, it may incorrectly reschedule the task, leading to a use-after-free scenario. The vulnerability was introduced during a migration from tasklets to workqueues, losing special handling for draining tasks. The fix reinstates the original behavior by forcing a continuation loop iteration when the state is TASK_STATE_DRAINING, ensuring the task finishes draining and transitions to TASK_STATE_DRAINED properly.
Potential Impact
Successful exploitation can lead to a use-after-free condition in the Linux kernel's RDMA/rxe driver, potentially allowing an attacker with local privileges to cause memory corruption. This can result in system instability, denial of service, or escalation of privileges due to the high impact on confidentiality, integrity, and availability as indicated by the CVSS vector.
Mitigation Recommendations
A fix for this vulnerability has been implemented in the Linux kernel by restoring the original pre-migration behavior in the do_task() function. Users should apply the official kernel updates that include this fix once available. Since no explicit patch links or vendor advisories are provided, check the Linux kernel vendor advisories or distribution security updates for the official patch and apply it promptly.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-c64c-4m7r-82v9
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-40061"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a6b72d79c2644c7f847b4cf
Added to database: 07/30/2026, 15:50:47 UTC
Last enriched: 07/30/2026, 16:22:10 UTC
Last updated: 09/10/2026, 19:24:56 UTC
Views: 43
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.