Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1434628

[PATCH net-next 01/19] rxrpc: Check the source of a packet to a client conn

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject [PATCH net-next 01/19] rxrpc: Check the source of a packet to a client conn
Date 2016-06-30 16:30 +0200
Message-ID <rPL8C-2eN-39@gated-at.bofh.it> (permalink)
References <rPKYV-2bo-9@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


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>
---

 net/rxrpc/conn_object.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/rxrpc/conn_object.c b/net/rxrpc/conn_object.c
index 4bfad7cf96cb..9381938187ac 100644
--- a/net/rxrpc/conn_object.c
+++ b/net/rxrpc/conn_object.c
@@ -509,7 +509,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;
 	}
 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH net-next 00/19] rxrpc: Improve conn/call lookup and fix call  number generation David Howells <dhowells@redhat.com> - 2016-06-30 16:30 +0200
  [PATCH net-next 05/19] rxrpc: Turn connection #defines into enums  and put outside struct def David Howells <dhowells@redhat.com> - 2016-06-30 16:30 +0200
  [PATCH net-next 04/19] rxrpc: Dup the main conn list for the proc  interface David Howells <dhowells@redhat.com> - 2016-06-30 16:30 +0200
  [PATCH net-next 02/19] rxrpc: Avoid using stack memory in SG lists  in rxkad David Howells <dhowells@redhat.com> - 2016-06-30 16:30 +0200
  [PATCH net-next 01/19] rxrpc: Check the source of a packet to a  client conn David Howells <dhowells@redhat.com> - 2016-06-30 16:30 +0200

csiph-web