[PATCH 6.1 1044/1887] rxrpc: Fix memory leaks in rxkad_verify_response()
Greg Kroah-Hartman
gregkh at linuxfoundation.org
Wed Oct 28 09:52:20 PDT 2026
6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <dhowells at redhat.com>
[ Upstream commit 34f61a07e0cdefaecd3ec03bb5fb22215643678f ]
Fix rxkad_verify_response() to free the ticket and the server key under all
circumstances by initialising the ticket pointer to NULL and then making
all paths through the function after the first allocation has been done go
through a single common epilogue that just releases everything - where all
the releases skip on a NULL pointer.
Fixes: 57af281e5389 ("rxrpc: Tidy up abort generation infrastructure")
Fixes: ec832bd06d6f ("rxrpc: Don't retain the server key in the connection")
Closes: https://sashiko.dev/#/patchset/20260408121252.2249051-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells at redhat.com>
cc: Marc Dionne <marc.dionne at auristor.com>
cc: Jeffrey Altman <jaltman at auristor.com>
cc: Simon Horman <horms at kernel.org>
cc: linux-afs at lists.infradead.org
cc: stable at kernel.org
Link: https://patch.msgid.link/20260422161438.2593376-2-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba at kernel.org>
Signed-off-by: Sasha Levin <sashal at kernel.org>
---
net/rxrpc/rxkad.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
index 038c4f2e8cef8..262b0df1e447b 100644
--- a/net/rxrpc/rxkad.c
+++ b/net/rxrpc/rxkad.c
@@ -1311,6 +1311,7 @@ static int rxkad_verify_response(struct rxrpc_connection *conn,
kfree(ticket);
kfree(response);
+ key_put(server_key);
_leave(" = 0");
return 0;
--
2.53.0
More information about the linux-afs
mailing list