]> git.baikalelectronics.ru Git - kernel.git/commit
RDS tcp loopback connection can hang
authorRao Shoaib <rao.shoaib@oracle.com>
Fri, 21 May 2021 18:08:06 +0000 (11:08 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 May 2021 21:46:59 +0000 (14:46 -0700)
commit4fae91d8f412038012d19deb3e645643faecf7cc
treeb7713e3c6bce52ef6e53146b2a53de7aeb51fbcc
parent57236fcbfb93f28863406c60fd070e649dabdd44
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>
net/rds/connection.c
net/rds/tcp.c
net/rds/tcp.h
net/rds/tcp_listen.c