Skip to content

Commit f45d01f

Browse files
QiushiWudhowells
authored andcommitted
rxrpc: Fix a memory leak in rxkad_verify_response()
A ticket was not released after a call of the function "rxkad_decrypt_ticket" failed. Thus replace the jump target "temporary_error_free_resp" by "temporary_error_free_ticket". Fixes: 8c2f826 ("rxrpc: Don't put crypto buffers on the stack") Signed-off-by: Qiushi Wu <[email protected]> Signed-off-by: David Howells <[email protected]> cc: Markus Elfring <[email protected]>
1 parent 8a1d24e commit f45d01f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/rxrpc/rxkad.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ static int rxkad_verify_response(struct rxrpc_connection *conn,
11481148
ret = rxkad_decrypt_ticket(conn, skb, ticket, ticket_len, &session_key,
11491149
&expiry, _abort_code);
11501150
if (ret < 0)
1151-
goto temporary_error_free_resp;
1151+
goto temporary_error_free_ticket;
11521152

11531153
/* use the session key from inside the ticket to decrypt the
11541154
* response */
@@ -1230,7 +1230,6 @@ static int rxkad_verify_response(struct rxrpc_connection *conn,
12301230

12311231
temporary_error_free_ticket:
12321232
kfree(ticket);
1233-
temporary_error_free_resp:
12341233
kfree(response);
12351234
temporary_error:
12361235
/* Ignore the response packet if we got a temporary error such as

0 commit comments

Comments
 (0)