rxrpc: Make /proc/net/rxrpc_calls safer

Make /proc/net/rxrpc_calls safer by stashing a copy of the peer pointer in
the rxrpc_call struct and checking in the show routine that the peer
pointer, the socket pointer and the local pointer obtained from the socket
pointer aren't NULL before we use them.

Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
David Howells
2016-08-24 14:31:43 +01:00
parent 2266ffdef5
commit df5d8bf70f
4 changed files with 26 additions and 9 deletions

View File

@@ -280,6 +280,7 @@ attached:
found_channel:
_debug("found chan");
call->conn = conn;
call->peer = rxrpc_get_peer(conn->params.peer);
call->cid = conn->proto.cid | chan;
call->call_id = ++conn->channels[chan].call_counter;
conn->channels[chan].call_id = call->call_id;