diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2022-03-25 10:37:31 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2022-03-25 13:22:58 -0400 |
commit | 421ab1be43bd015ffe744f4ea25df4f19d1ce6fe (patch) | |
tree | 1785c927d5e19320706b5fa78effe0fc9f271c71 /include/linux/sunrpc/xprtsock.h | |
parent | 1d15d121cc2ad4d016a7dc1493132a9696f91fc5 (diff) |
SUNRPC: Do not dereference non-socket transports in sysfs
Do not cast the struct xprt to a sock_xprt unless we know it is a UDP or
TCP transport. Otherwise the call to lock the mutex will scribble over
whatever structure is actually there. This has been seen to cause hard
system lockups when the underlying transport was RDMA.
Fixes: b49ea673e119 ("SUNRPC: lock against ->sock changing during sysfs read")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'include/linux/sunrpc/xprtsock.h')
-rw-r--r-- | include/linux/sunrpc/xprtsock.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h index 3eb0079669c5..38284f25eddf 100644 --- a/include/linux/sunrpc/xprtsock.h +++ b/include/linux/sunrpc/xprtsock.h @@ -10,7 +10,6 @@ int init_socket_xprt(void); void cleanup_socket_xprt(void); -unsigned short get_srcport(struct rpc_xprt *); #define RPC_MIN_RESVPORT (1U) #define RPC_MAX_RESVPORT (65535U) |