linux-stable/net/sunrpc
Chuck Lever 1ba1291172 SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP
[ Upstream commit 05258a0a69 ]

Jan Schunk reports that his small NFS servers suffer from memory
exhaustion after just a few days. A bisect shows that commit
e18e157bb5 ("SUNRPC: Send RPC message on TCP with a single
sock_sendmsg() call") is the first bad commit.

That commit assumed that sock_sendmsg() releases all the pages in
the underlying bio_vec array, but the reality is that it doesn't.
svc_xprt_release() releases the rqst's response pages, but the
record marker page fragment isn't one of those, so it is never
released.

This is a narrow fix that can be applied to stable kernels. A
more extensive fix is in the works.

Reported-by: Jan Schunk <scpcom@gmx.de>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218671
Fixes: e18e157bb5 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call")
Cc: Alexander Duyck <alexander.duyck@gmail.com>
Cc: Jakub Kacinski <kuba@kernel.org>
Cc: David Howells <dhowells@redhat.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-10 16:36:01 +02:00
..
auth_gss
xprtrdma
.kunitconfig
Kconfig
Makefile
addr.c
auth.c
auth_null.c
auth_tls.c
auth_unix.c
backchannel_rqst.c
cache.c
clnt.c
debugfs.c
fail.h
netns.h
rpc_pipe.c
rpcb_clnt.c
sched.c
socklib.c
socklib.h
stats.c
sunrpc.h
sunrpc_syms.c
svc.c
svc_xprt.c
svcauth.c
svcauth_unix.c
svcsock.c
sysctl.c
sysfs.c
sysfs.h
timer.c
xdr.c
xprt.c
xprtmultipath.c
xprtsock.c