summaryrefslogtreecommitdiff
path: root/net/rxrpc/key.c
diff options
context:
space:
mode:
authorDavid Howells2026-04-08 13:12:30 +0100
committerJakub Kicinski2026-04-08 18:44:31 -0700
commitb555912b9b21075e8298015f888ffe3ff60b1a97 (patch)
treeb4af2c0b28dac84527e03a54c0227389e5ab4e0e /net/rxrpc/key.c
parentbdbfead6d38979475df0c2f4bad2b19394fe9bdc (diff)
rxrpc: Fix key parsing memleak
In rxrpc_preparse_xdr_yfs_rxgk(), the memory attached to token->rxgk can be leaked in a few error paths after it's allocated. Fix this by freeing it in the "reject_token:" case. Fixes: 0ca100ff4df6 ("rxrpc: Add YFS RxGK (GSSAPI) security class") Closes: https://sashiko.dev/#/patchset/20260319150150.4189381-1-dhowells%40redhat.com Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: Jeffrey Altman <jaltman@auristor.com> cc: Simon Horman <horms@kernel.org> cc: linux-afs@lists.infradead.org cc: stable@kernel.org Link: https://patch.msgid.link/20260408121252.2249051-3-dhowells@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/rxrpc/key.c')
-rw-r--r--net/rxrpc/key.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c
index af403f0ccab5..26d4336a4a02 100644
--- a/net/rxrpc/key.c
+++ b/net/rxrpc/key.c
@@ -274,6 +274,7 @@ nomem_token:
nomem:
return -ENOMEM;
reject_token:
+ kfree(token->rxgk);
kfree(token);
reject:
return -EKEYREJECTED;