]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
tipc: close the connection if protocol messages contain errors
authorParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Wed, 26 Apr 2017 08:05:02 +0000 (10:05 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Apr 2017 16:20:42 +0000 (12:20 -0400)
commitc1be7756284b0fdbfe8aea8da968ce054697e0c5
tree105f419e4111501b0aee0067d9d566776d07dbc3
parent4e0df4951e9ecb7ec026a1330ed59f12e8937a95
tipc: close the connection if protocol messages contain errors

When a socket is shutting down, we notify the peer node about the
connection termination by reusing an incoming message if possible.
If the last received message was a connection acknowledgment
message, we reverse this message and set the error code to
TIPC_ERR_NO_PORT and send it to peer.

In tipc_sk_proto_rcv(), we never check for message errors while
processing the connection acknowledgment or probe messages. Thus
this message performs the usual flow control accounting and leaves
the session hanging.

In this commit, we terminate the connection when we receive such
error messages.

Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c