linux-stable/net/sunrpc
Chuck Lever a2ebedf7bc 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:38:14 +02:00
..
auth_gss SUNRPC: fix some memleaks in gssx_dec_option_array 2024-03-26 18:16:51 -04:00
xprtrdma svcrdma: Implement multi-stage Read completion again 2024-01-07 17:54:33 -05:00
.kunitconfig SUNRPC: Remove RPCSEC_GSS_KRB5_ENCTYPES_DES 2023-08-29 17:45:22 -04:00
Kconfig SUNRPC: Remove CONFIG_RPCSEC_GSS_KRB5_CRYPTOSYSTEM 2023-08-29 17:45:22 -04:00
Makefile
addr.c net: sunrpc: Fix an off by one in rpc_sockaddr2uaddr() 2024-03-26 18:17:24 -04:00
auth.c cred: get rid of CONFIG_DEBUG_CREDENTIALS 2023-12-15 14:19:48 -08:00
auth_null.c
auth_tls.c SUNRPC: Fail quickly when server does not recognize TLS 2023-09-27 15:16:40 -04:00
auth_unix.c
backchannel_rqst.c SUNRPC: change the back-channel queue to lwq 2023-10-16 12:44:08 -04:00
cache.c
clnt.c NFS Client Updates for Linux 6.8 2024-01-10 16:13:57 -08:00
debugfs.c
fail.h
netns.h
rpc_pipe.c sunrpc: convert to new timestamp accessors 2023-10-18 14:08:30 +02:00
rpcb_clnt.c SUNRPC: Add an IS_ERR() check back to where it was 2023-11-01 15:40:44 -04:00
sched.c
socklib.c
socklib.h
stats.c
sunrpc.h
sunrpc_syms.c net: fill in MODULE_DESCRIPTION()s for Sun RPC 2024-01-11 16:16:08 -08:00
svc.c NFSv4.1: Assign the right value for initval and retries for rpc timeout 2024-01-29 13:39:48 -05:00
svc_xprt.c svc: don't hold reference for poolstats, only mutex. 2024-01-07 17:54:33 -05:00
svcauth.c SUNRPC: Add a server-side API for retrieving an RPC's pseudoflavor 2024-01-07 17:54:25 -05:00
svcauth_unix.c SUNRPC: Add enum svc_auth_status 2023-08-29 17:45:22 -04:00
svcsock.c SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP 2024-04-10 16:38:14 +02:00
sysctl.c
sysfs.c
sysfs.h
timer.c
xdr.c NFS CLient Updates for Linux 6.6 2023-08-31 15:36:41 -07:00
xprt.c NFSv4.1: Use the nfs_client's rpc timeouts for backchannel 2024-01-04 17:01:01 -05:00
xprtmultipath.c SUNRPC: fix _xprt_switch_find_current_entry logic 2024-01-04 10:47:56 -05:00
xprtsock.c SUNRPC: Force close the socket when a hard error is reported 2023-10-22 19:47:57 -04:00