lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220907071338.56969-1-niejianglei2021@163.com>
Date:   Wed,  7 Sep 2022 15:13:38 +0800
From:   Jianglei Nie <niejianglei2021@....com>
To:     chuck.lever@...cle.com, jlayton@...nel.org,
        trond.myklebust@...merspace.com, anna@...nel.org,
        davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com
Cc:     linux-nfs@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Jianglei Nie <niejianglei2021@....com>
Subject: [PATCH] SUNRPC: Fix potential memory leak in xs_udp_send_request()

xs_udp_send_request() allocates a memory chunk for xdr->bvec with
xdr_alloc_bvec(). When xprt_sock_sendmsg() finishs, xdr->bvec is not
released, which will lead to a memory leak.

we should release the xdr->bvec with xdr_free_bvec() after
xprt_sock_sendmsg() like bc_sendto() does.

Signed-off-by: Jianglei Nie <niejianglei2021@....com>
---
 net/sunrpc/xprtsock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index e976007f4fd0..298182a3c168 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -958,6 +958,7 @@ static int xs_udp_send_request(struct rpc_rqst *req)
 		return status;
 	req->rq_xtime = ktime_get();
 	status = xprt_sock_sendmsg(transport->sock, &msg, xdr, 0, 0, &sent);
+	xdr_free_bvec(xdr);
 
 	dprintk("RPC:       xs_udp_send_request(%u) = %d\n",
 			xdr->len, status);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ