]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rds: tcp: Set linger when rejecting an incoming conn in rds_tcp_accept_one
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Fri, 16 Jun 2017 20:35:02 +0000 (13:35 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 18 Jun 2017 19:49:52 +0000 (12:49 -0700)
commit52ee94897a05d21964d2802eee0003efd2d634ba
tree6c1fee5921c39a4958d4a619fb3ba68889cb99e5
parent827ce89751a9a89666615d507d897c7a111fbe5a
rds: tcp: Set linger when rejecting an incoming conn in rds_tcp_accept_one

Each time we get an incoming SYN to the RDS_TCP_PORT, the TCP
layer accepts the connection and then the rds_tcp_accept_one()
callback is invoked to process the incoming connection.

rds_tcp_accept_one() may reject the incoming syn for a number of
reasons, e.g., commit 1a0e100fb2c9 ("RDS: TCP: Force every connection
to be initiated by numerically smaller IP address"), or because
we are getting spammed by a malicious node that is triggering
a flood of connection attempts to RDS_TCP_PORT. If the incoming
syn is rejected, no data would have been sent on the TCP socket,
and we do not need to be in TIME_WAIT state, so we set linger on
the TCP socket before closing, thereby closing the socket efficiently
with a RST.

Orabug: 26289770

(Cherry-pick of upstream 10beea7d7408d0b1c9208757f445c5c710239e0e)

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Tested-by: Imanti Mendez <imanti.mendez@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/tcp_listen.c