summaryrefslogtreecommitdiff
path: root/net/rxrpc
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-06-30 11:34:30 +0100
committerDavid Howells <dhowells@redhat.com>2016-07-06 10:43:05 +0100
commit689f4c646d6a8f0730eec11e06e5909de0b5d5d2 (patch)
treea8189f012e18787c8e375b095d110dfaa1b26800 /net/rxrpc
parent88b99d0b7af859bbd97e76d66527f107843340a5 (diff)
rxrpc: Check the source of a packet to a client conn
When looking up a client connection to which to route a packet, we need to check that the packet came from the correct source so that a peer can't try to muck around with another peer's connection. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc')
-rw-r--r--net/rxrpc/conn_object.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/rxrpc/conn_object.c b/net/rxrpc/conn_object.c
index c86a3cff7585..2c2456ff2853 100644
--- a/net/rxrpc/conn_object.c
+++ b/net/rxrpc/conn_object.c
@@ -508,7 +508,9 @@ struct rxrpc_connection *rxrpc_find_connection(struct rxrpc_local *local,
}
} else {
conn = idr_find(&rxrpc_client_conn_ids, cid >> RXRPC_CIDSHIFT);
- if (conn && conn->proto.epoch == epoch)
+ if (conn &&
+ conn->proto.epoch == epoch &&
+ conn->params.peer == peer)
goto found;
}