SUNRPC: Trap RDMA segment overflows
authorChuck Lever <chuck.lever@oracle.com>
Wed, 1 Jun 2022 16:46:52 +0000 (12:46 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Thu, 2 Jun 2022 17:05:58 +0000 (13:05 -0400)
commitf012e95b377c73c0283f009823c633104dedb337
tree00852c3bb9488472f8ac2aca2afb8a9d01399e98
parentb6c71c66b0ad8f2b59d9bc08c7a5079b110bec01
SUNRPC: Trap RDMA segment overflows

Prevent svc_rdma_build_writes() from walking off the end of a Write
chunk's segment array. Caught with KASAN.

The test that this fix replaces is invalid, and might have been left
over from an earlier prototype of the PCL work.

Fixes: 7a1cbfa18059 ("svcrdma: Use parsed chunk lists to construct RDMA Writes")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/xprtrdma/svc_rdma_rw.c