CVE-2026-89508: RDMA/ucma: Lock the handler in ucma_set_ib_path()
In the Linux kernel, the following vulnerability has been resolved:
RDMA/ucma: Lock the handler in ucmasetibpath()
ucmasetibpath() calls ucmaeventhandler() straight from the write() path, without the handler lock that keeps ctx->file stable while a uevent is queued. The handler re-reads ctx->file for every dereference:
mutexlock(&ctx->file->mut); / file A / listaddtail(&uevent->list, &ctx->file->eventlist); / file B / mutexunlock(&ctx->file->mut); / file B / wakeupinterruptible(&ctx->file->pollwait); / file B /
A concurrent ucmamigrateid() reassigns ctx->file while the SETOPTION caller sleeps in mutexlock(), so the listaddtail() lands on file B's eventlist while only file A's mutex is held, racing every other user of that list:
BUG: KASAN: slab-use-after-free in listaddvalidorreport+0x1aa/0x1c0 Read of size 8 at addr ffff888153c6a418 by task poccorr/486 Call Trace: listaddvalidorreport+0x1aa/0x1c0 ucmaeventhandler+0x1be/0xc00 ucmasetibpath+0x45e/0x710 ucmasetoption+0x32e/0x590 ucmawrite+0x1f9/0x330 Allocated by task 505: ucmawritecmevent+0x1a1/0x660 Freed by task 505: kfree+0x1da/0x4c0 ucmagetevent+0x5d5/0x7e0
The freed object is a ucmaevent that another thread dequeued from file B's list under file B's mutex. File A's mut is left held on top of that, wedging its next writer in uninterruptible sleep.
This path needs a bound and address-resolved cmid, so it requires an RDMA device to be present.
Take the handler lock around the call.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernel RDMA/ucmato a version that resolves this vulnerability.Patch RDMA/ucma: Lock the handler in ucma_set_ib_path() - Compensating control
Ensure concurrency safety by taking the handler lock around the call in ucma_set_ib_path() (i.e., lock the handler while ucma_event_handler() executes / while re-reading ctx->file) to prevent ctx->file from being reassigned during event_list manipulation.
Event History
Frequently Asked Questions
What conditions are required to trigger this issue?
The race requires concurrent use of ucma_set_ib_path() through the write path and ucma_migrate_id(). The migration can reassign ctx->file while the SET_OPTION caller is waiting to acquire the file mutex.
What is the observed impact of the race?
An event can be added to one file's event list while holding a different file's mutex, racing with other access to that list. The reported result is a KASAN-detected slab use-after-free in __list_add_valid_or_report.
How can administrators identify exposure from kernel diagnostics?
Look for KASAN slab-use-after-free reports involving __list_add_valid_or_report, ucma_event_handler, ucma_set_ib_path, ucma_set_option, and ucma_write. The trace may also show allocation in ucma_write_cm_event and freeing through ucma_get_event.