diff options
author | Rao Shoaib <rao.shoaib@oracle.com> | 2021-05-21 11:08:06 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-05-21 14:46:59 -0700 |
commit | aced3ce57cd37b5ca332bcacd370d01f5a8c5371 (patch) | |
tree | b7713e3c6bce52ef6e53146b2a53de7aeb51fbcc /net/rds/tcp.h | |
parent | 29bf1993fdba17703a836cf098712cf15f96706d (diff) | |
download | linux-aced3ce57cd37b5ca332bcacd370d01f5a8c5371.tar.bz2 |
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.h')
-rw-r--r-- | net/rds/tcp.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/rds/tcp.h b/net/rds/tcp.h index bad9cf49d565..dc8d745d6857 100644 --- a/net/rds/tcp.h +++ b/net/rds/tcp.h @@ -59,7 +59,8 @@ u32 rds_tcp_snd_una(struct rds_tcp_connection *tc); u64 rds_tcp_map_seq(struct rds_tcp_connection *tc, u32 seq); extern struct rds_transport rds_tcp_transport; void rds_tcp_accept_work(struct sock *sk); - +int rds_tcp_laddr_check(struct net *net, const struct in6_addr *addr, + __u32 scope_id); /* tcp_connect.c */ int rds_tcp_conn_path_connect(struct rds_conn_path *cp); void rds_tcp_conn_path_shutdown(struct rds_conn_path *conn); |