[PATCH v3 0/2] RDMA/srpt: fix the indirect descriptor table bound and the context counters

From: Yehyeong Lee

Date: Thu Oct 22 2026 - 10:46:54 EST


Both changes are needed, and they fix different things.

A 510 entry table fits in the default 8276 byte IU when the additional CDB
is empty, so the bound accepts it and the counters then have to hold it.
With only the bound, a conforming command carrying 256 or more descriptors
still wraps n_rw_ctx and leaks every context it allocated. With only the
wider counters, a command that sets ADDITIONAL CDB LENGTH to its maximum
still walks a descriptor table that runs past the receive buffer.

The two defects also come from different commits, which is why they are
split here.

Changes since v2, all from Bart's review. The two fixes are separate
patches now. The widening patch says that n_rdma accumulates the
rdma_rw_ctx_init() work request counts, so it can pass 255 with only a
handful of descriptors, which is more than the 256 descriptor wrap. The
separate descriptor header pre-check is gone, folded into one room test
placed after the existing count guard, because the header can never fall
outside the buffer.

Yehyeong Lee (2):
RDMA/srpt: bound the indirect descriptor table to the IU
RDMA/srpt: widen the indirect RDMA context counters

drivers/infiniband/ulp/srpt/ib_srpt.c | 12 +++++++++++-
drivers/infiniband/ulp/srpt/ib_srpt.h | 4 ++--
2 files changed, 13 insertions(+), 3 deletions(-)


base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
--
2.43.0