]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
SUNRPC: Fix a memory leak in the backchannel code
authorTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 1 Jun 2015 19:10:25 +0000 (15:10 -0400)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 Sep 2015 11:52:10 +0000 (13:52 +0200)
commit 88de6af24f2b48b06c514d3c3d0a8f22fafe30bd upstream.

req->rq_private_buf isn't initialised when xprt_setup_backchannel calls
xprt_free_allocation.

Fixes: fb7a0b9addbdb ("nfs41: New backchannel helper routines")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
(cherry picked from commit bd031759bcc0865938ecc52846a3f22f2a26ad8e)

Signed-off-by: Willy Tarreau <w@1wt.eu>
net/sunrpc/backchannel_rqst.c

index 553621fb2c41f2063630b83fd74d03cd71d9b7ab..b993a49d8a9241de33aea33cf483336453ace049 100644 (file)
@@ -59,7 +59,7 @@ static void xprt_free_allocation(struct rpc_rqst *req)
 
        dprintk("RPC:        free allocations for req= %p\n", req);
        BUG_ON(test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state));
-       xbufp = &req->rq_private_buf;
+       xbufp = &req->rq_rcv_buf;
        free_page((unsigned long)xbufp->head[0].iov_base);
        xbufp = &req->rq_snd_buf;
        free_page((unsigned long)xbufp->head[0].iov_base);