From: Santosh Shilimkar Date: Thu, 15 Dec 2016 21:21:09 +0000 (-0800) Subject: RDS: don't commit to queue till transport connection is up X-Git-Tag: v4.1.12-92~19^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=238a807df5e57afb4b1e13ba87015093e3212247;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/net/rds/send.c b/net/rds/send.c index 36897d781fa8a..cb90d3beda14f 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);