svcrdma: Prevent a UAF in svc_rdma_send()
authorChuck Lever <chuck.lever@oracle.com>
Sun, 4 Feb 2024 23:17:09 +0000 (18:17 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 1 Mar 2024 14:12:27 +0000 (09:12 -0500)
commit773f6c5b72d96be1f8fca0f1f7a58babbb3a9c26
treeef61651f65b401b81e984fcf3e2bdcf74ea1ebbb
parent5b9a85899c93430ff5173748fbcb79f28af21388
svcrdma: Prevent a UAF in svc_rdma_send()

In some error flow cases, svc_rdma_wc_send() releases @ctxt. Copy
the sc_cid field in @ctxt to a stack variable in order to guarantee
that the value is available after the ib_post_send() call.

In case the new comment looks a little strange, this will be done
with at least one more field in a subsequent patch.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/xprtrdma/svc_rdma_sendto.c