Skip to content

Commit

Permalink
rxrpc: Validate the net address given to rxrpc_kernel_begin_call()
Browse files Browse the repository at this point in the history
Validate the net address given to rxrpc_kernel_begin_call() before using
it.

Whilst this should be mostly unnecessary for in-kernel users, it does clear
the tail of the address struct in case we want to hash or compare the whole
thing.

Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
David Howells committed Jun 22, 2016
1 parent 4a3388c commit f4552c2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net/rxrpc/af_rxrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,14 @@ struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *sock,
struct rxrpc_transport *trans;
struct rxrpc_call *call;
struct rxrpc_sock *rx = rxrpc_sk(sock->sk);
int ret;

_enter(",,%x,%lx", key_serial(key), user_call_ID);

ret = rxrpc_validate_address(rx, srx, sizeof(*srx));
if (ret < 0)
return ERR_PTR(ret);

lock_sock(&rx->sk);

if (!key)
Expand Down

0 comments on commit f4552c2

Please sign in to comment.