CVE-2026-139359: RDMA/rxe: refuse to destroy a QP with type 2 MWs still bound
In the Linux kernel, the following vulnerability has been resolved:
RDMA/rxe: refuse to destroy a QP with type 2 MWs still bound
Binding a type 2 memory window takes a reference on the QP: rxedobindmw() does rxeget(qp) and stores it in mw->qp. That reference is released only when the window is invalidated (rxedoinvalidatemw() on IBWRLOCALINV) or the window itself is destroyed (rxemwcleanup()).
rxeqpchkdestroy() does not account for those references -- it only refuses when qp->mcgnum is non-zero. So an unprivileged user can bind a type 2 MW to a QP and then destroy the QP while the binding is still live. rxecleanup() cannot drop the QP refcount to zero (the MW still holds a reference), hits its -ETIMEDOUT path, and frees the QP anyway; mw->qp is left dangling. When the MW is later invalidated or deallocated, rxemwcleanup()/rxedoinvalidatemw() do rxeput(mw->qp) on the freed struct rxeqp -- a use-after-free write (refcountdec, and complete()/list work if it reaches zero) reachable from userspace. IBWRBINDMW is a local operation, so no peer is required.
Track the number of type 2 MWs bound to a QP and refuse to destroy the QP while that count is non-zero, returning -EBUSY exactly as the existing multicast-attachment check does. The window must be invalidated or deallocated, which drops the reference and the count, before the QP can be destroyed.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Track the number of type 2 memory windows bound to each QP, and refuse to destroy the QP while that count is non-zero.