From 238a807df5e57afb4b1e13ba87015093e3212247 Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Thu, 15 Dec 2016 13:21:09 -0800 Subject: [PATCH] RDS: don't commit to queue till transport connection is up A rouge application can flood the send queue by targeting a dead or non-existing node. Don't commit any messages to the queue till the legitimate connection to the peer is established. Let application retry so that only legit connections can get on to the send queue. Orabug: 25393611 Reviewed-by: Sowmini Varadhan Signed-off-by: Santosh Shilimkar --- net/rds/send.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/rds/send.c b/net/rds/send.c index 36897d781fa8..cb90d3beda14 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -1388,6 +1388,11 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len) goto out; } + if (!rds_conn_up(conn)) { + ret = -EAGAIN; + goto out; + } + while (!rds_send_queue_rm(rs, conn, rm, rs->rs_bound_port, dport, &queued)) { rds_stats_inc(s_send_queue_full); -- 2.50.1