[PATCH v5 0/3] RDMA/srpt: Fix command initialization and read buffer disclosure

From: Yong Liu

Date: Fri Nov 13 2026 - 07:03:46 EST


Hi Bart,

Thanks for the review and suggestions. This revision separates the BUSY
initialization fix and the target core control-read buffer fix from the
SRPT descriptor validation and read-tail clearing fix. Together they
address the NULL pointer dereference on descriptor parsing errors and
uninitialized target kernel memory disclosure to an initiator.

Changes in v5:
- Move BUSY command initialization into patch 1 and explain why the
target_init_cmd() return value is ignored.
- Clear all control-read SG entries in target core in patch 2.
- In patch 3, log inconsistent descriptor lengths and zero the read tail
with one sg_zero_buffer() call through the command's chained SG list.
Remove the SRPT-specific DMA synchronization.

> Do the SRP tests from https://github.com/linux-blktests/blktests still
> pass?

I ran the following against this v5 series in an x86-64 QEMU VM using RXE,
with blktests commit 79c32fb31b7bca6a4383b749030128683cf6b6b4:

USE_RXE=1 ./check srp

Results: 13 passed, 2 skipped, 0 failed. Tests srp/003 and srp/004 require
legacy single-queue device mapper support, which is absent from this
kernel. The multiqueue test, srp/002, passed. The kernel and modules also
build successfully.

This series is based on commit:
f66469d9905b39d2c260a15d7d6db450f4db67c1

Regards,
Yong Liu
360 Vulnerability Research Institute

Yong Liu (3):
RDMA/srpt: Initialize commands before returning BUSY
scsi: target: Clear all control read scatterlist entries
RDMA/srpt: Prevent uninitialized read buffer disclosure

drivers/infiniband/ulp/srpt/ib_srpt.c | 24 ++++++++++++++++++++++++
drivers/infiniband/ulp/srpt/ib_srpt.h | 2 ++
drivers/target/target_core_transport.c | 19 ++++++-------------
3 files changed, 32 insertions(+), 13 deletions(-)

--
2.43.0