aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2012-04-26 18:13:08 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-04-27 10:08:00 -0400
commitaad585473fe1e4b07f2ec1e2432475937f90c385 (patch)
tree912d287ceb53b56622e7480bea470dedc855e93c /net/tipc/socket.c
parent8f1778969359a71f398c9ac6d3a9a3e61439b466 (diff)
tipc: Reject payload messages with invalid message type
Adds check to ensure TIPC sockets reject incoming payload messages that have an unrecognized message type. Remove the old open question about whether TIPC_ERR_NO_PORT is the proper return value. It is appropriate here since there are valid instances where another node can make use of the reply, and at this point in time the host is already broadcasting TIPC data, so there are no real security concerns. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r--net/tipc/socket.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 6d4991e8f670..3c00b40f815f 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1223,11 +1223,8 @@ static u32 filter_rcv(struct sock *sk, struct sk_buff *buf)
1223 1223
1224 /* Reject message if it is wrong sort of message for socket */ 1224 /* Reject message if it is wrong sort of message for socket */
1225 1225
1226 /* 1226 if (msg_type(msg) > TIPC_DIRECT_MSG)
1227 * WOULD IT BE BETTER TO JUST DISCARD THESE MESSAGES INSTEAD? 1227 return TIPC_ERR_NO_PORT;
1228 * "NO PORT" ISN'T REALLY THE RIGHT ERROR CODE, AND THERE MAY
1229 * BE SECURITY IMPLICATIONS INHERENT IN REJECTING INVALID TRAFFIC
1230 */
1231 1228
1232 if (sock->state == SS_READY) { 1229 if (sock->state == SS_READY) {
1233 if (msg_connected(msg)) 1230 if (msg_connected(msg))