[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1428666313-9117-1-git-send-email-erik.hugne@ericsson.com>
Date: Fri, 10 Apr 2015 13:45:13 +0200
From: <erik.hugne@...csson.com>
To: <richard.alpe@...csson.com>, <jon.maloy@...csson.com>,
<ying.xue@...driver.com>, <netdev@...r.kernel.org>
CC: <tipc-discussion@...ts.sourceforge.net>,
Erik Hugne <erik.hugne@...csson.com>
Subject: [PATCH] tipc: don't reject messages if reversal fails
From: Erik Hugne <erik.hugne@...csson.com>
When we fail to deliver a message to a socket, it is subject to
message reversal. If the call to tipc_msg_reverse fails, we are
passing dnode uninitialized to tipc_link_xmit_skb which causes the
packet to either be dropped, or sent out to a random link. In the
worst case this leads to a link reset.
We fix this by only transmitting the message if reversal succeded.
Signed-off-by: Erik Hugne <erik.hugne@...csson.com>
---
net/tipc/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ee90d74..34bc96c 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1701,7 +1701,7 @@ static int tipc_backlog_rcv(struct sock *sk, struct sk_buff *skb)
atomic_add(truesize, dcnt);
return 0;
}
- if (!err || tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode, -err))
+ if (!err && tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode, -err))
tipc_link_xmit_skb(net, skb, dnode, tsk->portid);
return 0;
}
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists