]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
RDS: don't commit to queue till transport connection is up
authorSantosh Shilimkar <santosh.shilimkar@oracle.com>
Thu, 15 Dec 2016 21:21:09 +0000 (13:21 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 20 Jan 2017 09:06:25 +0000 (01:06 -0800)
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 <sowmini.varadhan@oracle.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
net/rds/send.c

index 36897d781fa8af42a16d00e81396212de2684ec8..cb90d3beda14f7a68e38261f10827d49bdf4a79d 100644 (file)
@@ -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);