From: David Howells Date: Thu, 30 Jun 2016 10:34:30 +0000 (+0100) Subject: rxrpc: Check the source of a packet to a client conn X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=689f4c646d6a8f0730eec11e06e5909de0b5d5d2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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; }