Skip to content

Commit aad5854

Browse files
ajstephensPaul Gortmaker
authored andcommitted
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>
1 parent 8f17789 commit aad5854

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎net/tipc/socket.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,11 +1223,8 @@ static u32 filter_rcv(struct sock *sk, struct sk_buff *buf)
12231223

12241224
/* Reject message if it is wrong sort of message for socket */
12251225

1226-
/*
1227-
* WOULD IT BE BETTER TO JUST DISCARD THESE MESSAGES INSTEAD?
1228-
* "NO PORT" ISN'T REALLY THE RIGHT ERROR CODE, AND THERE MAY
1229-
* BE SECURITY IMPLICATIONS INHERENT IN REJECTING INVALID TRAFFIC
1230-
*/
1226+
if (msg_type(msg) > TIPC_DIRECT_MSG)
1227+
return TIPC_ERR_NO_PORT;
12311228

12321229
if (sock->state == SS_READY) {
12331230
if (msg_connected(msg))

0 commit comments

Comments
 (0)