linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/2] rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle()
@ 2021-11-21  4:16 Eiichi Tsukata
  2021-11-21  4:16 ` [PATCH net 2/2] rxrpc: Fix rxrpc_local leak in rxrpc_lookup_peer() Eiichi Tsukata
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Eiichi Tsukata @ 2021-11-21  4:16 UTC (permalink / raw)
  To: dhowells, marc.dionne, davem, kuba, linux-afs, netdev, linux-kernel
  Cc: Eiichi Tsukata

Need to call rxrpc_put_peer() for bundle candidate before kfree() as it
holds a ref to rxrpc_peer.

Fixes: 245500d853e9 ("rxrpc: Rewrite the client connection manager")
Signed-off-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
---
 net/rxrpc/conn_client.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c
index dbea0bfee48e..46dcb33888ff 100644
--- a/net/rxrpc/conn_client.c
+++ b/net/rxrpc/conn_client.c
@@ -328,6 +328,7 @@ static struct rxrpc_bundle *rxrpc_look_up_bundle(struct rxrpc_conn_parameters *c
 	return candidate;
 
 found_bundle_free:
+	rxrpc_put_peer(candidate->params.peer);
 	kfree(candidate);
 found_bundle:
 	rxrpc_get_bundle(bundle);
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH net 0/2] rxrpc: Leak fixes
@ 2021-11-29 15:49 David Howells
  2021-11-29 15:49 ` [PATCH net 1/2] rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle() David Howells
  0 siblings, 1 reply; 6+ messages in thread
From: David Howells @ 2021-11-29 15:49 UTC (permalink / raw)
  To: netdev
  Cc: linux-afs, Marc Dionne, Eiichi Tsukata, dhowells, linux-afs,
	linux-kernel


Here are a couple of fixes for leaks in AF_RXRPC:

 (1) Fix a leak of rxrpc_peer structs in rxrpc_look_up_bundle().

 (2) Fix a leak of rxrpc_local structs in rxrpc_lookup_peer().

The patches are tagged here:

	git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
	rxrpc-fixes-20211129

and can also be found on the following branch:

	http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes

David
---
Eiichi Tsukata (2):
      rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle()
      rxrpc: Fix rxrpc_local leak in rxrpc_lookup_peer()


 net/rxrpc/peer_object.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-29 15:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-21  4:16 [PATCH net 1/2] rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle() Eiichi Tsukata
2021-11-21  4:16 ` [PATCH net 2/2] rxrpc: Fix rxrpc_local leak in rxrpc_lookup_peer() Eiichi Tsukata
2021-11-23 14:11   ` Marc Dionne
2021-11-23 14:12 ` [PATCH net 1/2] rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle() Marc Dionne
2021-11-24 14:21 ` David Howells
2021-11-29 15:49 [PATCH net 0/2] rxrpc: Leak fixes David Howells
2021-11-29 15:49 ` [PATCH net 1/2] rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle() David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).