]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
svcrdma: Fix leak of svc_rdma_recv_ctxt objects
authorChuck Lever <chuck.lever@oracle.com>
Tue, 31 Mar 2020 21:02:33 +0000 (17:02 -0400)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 25 May 2020 08:42:05 +0000 (10:42 +0200)
commit96e5e0cac448d16d85c2841e77b1df9c6fa6b176
tree433a53dc0115efb266a9b7dab56ce214dd80b25f
parent0006926206b69d86a82b95289f7b20b5ba6b4527
svcrdma: Fix leak of svc_rdma_recv_ctxt objects

BugLink: https://bugs.launchpad.net/bugs/1876765
commit 23cf1ee1f1869966b75518c59b5cbda4c6c92450 upstream.

Utilize the xpo_release_rqst transport method to ensure that each
rqstp's svc_rdma_recv_ctxt object is released even when the server
cannot return a Reply for that rqstp.

Without this fix, each RPC whose Reply cannot be sent leaks one
svc_rdma_recv_ctxt. This is a 2.5KB structure, a 4KB DMA-mapped
Receive buffer, and any pages that might be part of the Reply
message.

The leak is infrequent unless the network fabric is unreliable or
Kerberos is in use, as GSS sequence window overruns, which result
in connection loss, are more common on fast transports.

Fixes: 3a88092ee319 ("svcrdma: Preserve Receive buffer until svc_rdma_sendto")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/linux/sunrpc/svc_rdma.h
net/sunrpc/svc_xprt.c
net/sunrpc/svcsock.c
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
net/sunrpc/xprtrdma/svc_rdma_sendto.c
net/sunrpc/xprtrdma/svc_rdma_transport.c