aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/rds/tcp.c
diff options
context:
space:
mode:
authorRao Shoaib <rao.shoaib@oracle.com>2021-05-21 11:08:06 -0700
committerDavid S. Miller <davem@davemloft.net>2021-05-21 14:46:59 -0700
commitaced3ce57cd37b5ca332bcacd370d01f5a8c5371 (patch)
treeb7713e3c6bce52ef6e53146b2a53de7aeb51fbcc /net/rds/tcp.c
parentMAINTAINERS: remove Ioana Radulescu from dpaa2-eth (diff)
downloadwireguard-linux-aced3ce57cd37b5ca332bcacd370d01f5a8c5371.tar.xz
wireguard-linux-aced3ce57cd37b5ca332bcacd370d01f5a8c5371.zip
RDS tcp loopback connection can hang
When TCP is used as transport and a program on the system connects to RDS port 16385, connection is accepted but denied per the rules of RDS. However, RDS connections object is left in the list. Next loopback connection will select that connection object as it is at the head of list. The connection attempt will hang as the connection object is set to connect over TCP which is not allowed The issue can be reproduced easily, use rds-ping to ping a local IP address. After that use any program like ncat to connect to the same IP address and port 16385. This will hang so ctrl-c out. Now try rds-ping, it will hang. To fix the issue this patch adds checks to disallow the connection object creation and destroys the connection object. Signed-off-by: Rao Shoaib <rao.shoaib@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/tcp.c')
-rw-r--r--net/rds/tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index 43db0eca911f..abf19c0e3ba0 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -313,8 +313,8 @@ out:
}
#endif
-static int rds_tcp_laddr_check(struct net *net, const struct in6_addr *addr,
- __u32 scope_id)
+int rds_tcp_laddr_check(struct net *net, const struct in6_addr *addr,
+ __u32 scope_id)
{
struct net_device *dev = NULL;
#if IS_ENABLED(CONFIG_IPV6)