CVE-2026-139356: RDMA/rxe: validate inline sge_offset in finish_packet() before indexing inline_data[]
In the Linux kernel, the following vulnerability has been resolved:
RDMA/rxe: validate inline sgeoffset in finishpacket() before indexing inlinedata[]
For a user QP, rxepostsend() takes the qp->isuser branch and never runs initsendwqe(), so dma.length/resid/numsge/cursge/sgeoffset all come straight from the mmap'd SQ ring. In the inline send path finishpacket() uses sgeoffset directly as an index:
u8 tmp = &wqe->dma.inlinedata[wqe->dma.sgeoffset]; memcpy(payloadaddr(pkt), tmp, payload);
inlinedata is a flex array whose capacity is qp->sq.maxinline, but sgeoffset is a u32 from user space, so the source pointer is displaced arbitrarily past the WQE and the memcpy reads out of bounds. commit 126c757e4cd4 ("RDMA/rxe: Validate numsge/cursge before indexing wqe->dma.sge[]") added numsge/cursge checks on the send path but not sgeoffset, the third attacker-controlled index in the same struct.
Read sgeoffset once with READONCE() and bound it (and the payload that follows it) by qp->sq.maxinline before indexing, so the value that is validated is the value that is used.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In RDMA/rxe's inline send path, read sge_offset once with READ_ONCE(), then validate that sge_offset and the payload length that follows it are within qp->sq.max_inline before indexing inline_data[].