diff options
author | David Howells <dhowells@redhat.com> | 2016-06-17 11:00:48 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2016-06-22 09:17:51 +0100 |
commit | f4552c2d248e9d9f6f728ea32eb25f600d3d6cd6 (patch) | |
tree | 2236af71df6ff792ac2d2ffd9f483ffcfd5c3c18 /net/rxrpc | |
parent | 4a3388c8033e4ea00f06a341d5ed4a20a7da89de (diff) | |
download | linux-f4552c2d248e9d9f6f728ea32eb25f600d3d6cd6.tar.bz2 |
rxrpc: Validate the net address given to rxrpc_kernel_begin_call()
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>
Diffstat (limited to 'net/rxrpc')
-rw-r--r-- | net/rxrpc/af_rxrpc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c index 408bd024125b..b29bb50af5de 100644 --- a/net/rxrpc/af_rxrpc.c +++ b/net/rxrpc/af_rxrpc.c @@ -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) |