]> git.baikalelectronics.ru Git - kernel.git/commit
xprtrdma: Fix trace point use-after-free race
authorChuck Lever <chuck.lever@oracle.com>
Mon, 20 Apr 2020 00:03:05 +0000 (20:03 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Mon, 20 Apr 2020 14:44:01 +0000 (10:44 -0400)
commit62916ace88c95db63aec1b9c5bd3e7669b95517b
tree951e3fdca0873b24e24553fa297a6f49d2722f46
parentcee3eeed5f60c2f73c0c9cc93fc6ee068d21aef6
xprtrdma: Fix trace point use-after-free race

It's not safe to use resources pointed to by the @send_wr of
ib_post_send() _after_ that function returns. Those resources are
typically freed by the Send completion handler, which can run before
ib_post_send() returns.

Thus the trace points currently around ib_post_send() in the
client's RPC/RDMA transport are a hazard, even when they are
disabled. Rearrange them so that they touch the Work Request only
_before_ ib_post_send() is invoked.

Fixes: 3e4ee95e6936 ("xprtrdma: Add trace points in RPC Call transmit paths")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
include/trace/events/rpcrdma.h
net/sunrpc/xprtrdma/verbs.c