[PATCH v10 0/2] RDMA/rxe: copy send WQE to kernel buffer (TOCTOU hardening)
From: Tristan Madani
Date: Fri Oct 30 2026 - 15:32:54 EST
The SoftRoCE (rxe) send queue is mmap-ed into userspace, allowing
the requester and completer to process work queue entries (WQEs)
whose fields can change between kernel reads.
This series copies each WQE to a kernel-private buffer before
processing: patch 1 for the requester, patch 2 for the completer.
Both paths validate opcode bounds and SGE indices after copying,
preserve DMA progress across multi-packet operations, and write
back updated fields to the shared queue via WRITE_ONCE / smp_store_release.
Changes since v9:
- Patch 1: check dma.resid != sizeof(u64) instead of just > to
also catch undersized resid that leaks uninitialized pad bytes.
- Bisection fix: move qp->comp.comp_wqe_valid invalidation from
patch 1 to patch 2, where the field is first defined.
Tristan Madani (2):
RDMA/rxe: copy send WQE to kernel buffer before processing
RDMA/rxe: copy send WQE to kernel buffer in completer path
drivers/infiniband/sw/rxe/rxe_comp.c | 76 ++++++++++++++++++++++++++-
drivers/infiniband/sw/rxe/rxe_qp.c | 2 +
drivers/infiniband/sw/rxe/rxe_req.c | 72 +++++++++++++++++++++++--
drivers/infiniband/sw/rxe/rxe_verbs.h | 12 +++++
4 files changed, 155 insertions(+), 7 deletions(-)
--
2.47.3