linux-stable/net/sunrpc
Dan Carpenter 9b405c0f84 nfsd: fix double fget() bug in __write_ports_addfd()
[ Upstream commit c034203b6a ]

The bug here is that you cannot rely on getting the same socket
from multiple calls to fget() because userspace can influence
that.  This is a kind of double fetch bug.

The fix is to delete the svc_alien_sock() function and instead do
the checking inside the svc_addsock() function.

Fixes: 3064639423 ("nfsd: check passed socket's net matches NFSd superblock's one")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: NeilBrown <neilb@suse.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2024-04-10 16:19:28 +02:00
..
auth_gss Revert "SUNRPC: Use RMW bitops in single-threaded hot paths" 2024-04-10 16:19:25 +02:00
xprtrdma Revert "SUNRPC: Use RMW bitops in single-threaded hot paths" 2024-04-10 16:19:25 +02:00
addr.c net: sunrpc: Fix an off by one in rpc_sockaddr2uaddr() 2024-03-26 18:21:33 -04:00
auth.c sunrpc: fix expiry of auth creds 2022-08-25 11:40:05 +02:00
auth_null.c
auth_unix.c
backchannel_rqst.c SUNRPC: Reinitialise the backchannel request buffers before reuse 2022-08-25 11:40:05 +02:00
cache.c
clnt.c SUNRPC: Fix RPC client cleaned up the freed pipefs dentries 2023-11-28 16:56:22 +00:00
debugfs.c
fail.h
Kconfig
Makefile
netns.h
rpc_pipe.c
rpcb_clnt.c SUNRPC: Add an IS_ERR() check back to where it was 2023-11-28 16:56:21 +00:00
sched.c SUNRPC: remove the maximum number of retries in call_bind_status 2023-05-11 23:00:37 +09:00
socklib.c
socklib.h
stats.c
sunrpc.h
sunrpc_syms.c
svc.c Revert "SUNRPC: Use RMW bitops in single-threaded hot paths" 2024-04-10 16:19:25 +02:00
svc_xprt.c Revert "SUNRPC: Use RMW bitops in single-threaded hot paths" 2024-04-10 16:19:25 +02:00
svcauth.c
svcauth_unix.c sunrpc: only free unix grouplist after RCU settles 2023-04-13 16:48:19 +02:00
svcsock.c nfsd: fix double fget() bug in __write_ports_addfd() 2024-04-10 16:19:28 +02:00
sysctl.c
sysfs.c SUNRPC: Fix null-ptr-deref when xps sysfs alloc failed 2022-11-10 18:15:26 +01:00
sysfs.h
timer.c
xdr.c NFSD: Refactor common code out of dirlist helpers 2024-04-10 16:19:17 +02:00
xprt.c SUNRPC: Ensure we flush any closed sockets before xs_xprt_free() 2022-05-18 10:26:57 +02:00
xprtmultipath.c SUNRPC: Fix a suspicious RCU usage warning 2024-02-23 08:54:40 +01:00
xprtsock.c SUNRPC: fix shutdown of NFS TCP client socket 2023-04-05 11:24:55 +02:00