]> git.baikalelectronics.ru Git - kernel.git/commit
rxrpc: Fix leak of rxrpc_peer objects
authorDavid Howells <dhowells@redhat.com>
Fri, 30 Mar 2018 20:05:44 +0000 (21:05 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 30 Mar 2018 20:05:44 +0000 (21:05 +0100)
commit99157f5af4740e420ca30091c199f21ee5fd8f6c
tree49ef90fafb4ae55ff13e0c373a81bbc509718bd8
parentc01a428a06ad2ed373f345ee3a605858e4008617
rxrpc: Fix leak of rxrpc_peer objects

When a new client call is requested, an rxrpc_conn_parameters struct object
is passed in with a bunch of parameters set, such as the local endpoint to
use.  A pointer to the target peer record is also placed in there by
rxrpc_get_client_conn() - and this is removed if and only if a new
connection object is allocated.  Thus it leaks if a new connection object
isn't allocated.

Fix this by putting any peer object attached to the rxrpc_conn_parameters
object in the function that allocated it.

Fixes: caa17381beb1 ("rxrpc: Use structs to hold connection params and protocol info")
Signed-off-by: David Howells <dhowells@redhat.com>
net/rxrpc/af_rxrpc.c
net/rxrpc/ar-internal.h
net/rxrpc/net_ns.c
net/rxrpc/peer_object.c
net/rxrpc/sendmsg.c