rxrpc: fix rxkad_verify_response()
authorDan Carpenter <error27@gmail.com>
Thu, 17 Nov 2022 07:43:38 +0000 (10:43 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Nov 2022 12:02:05 +0000 (12:02 +0000)
The error handling for if skb_copy_bits() fails was accidentally deleted
so the rxkad_decrypt_ticket() function is not called.

Fixes: 5d7edbc9231e ("rxrpc: Get rid of the Rx ring")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rxrpc/rxkad.c

index 2706e59bf9923ef3f9eb7adab5a73a5fab64e982..110a5550c0a6999b89f43d994f4c94671a79260f 100644 (file)
@@ -1165,8 +1165,10 @@ static int rxkad_verify_response(struct rxrpc_connection *conn,
 
        eproto = tracepoint_string("rxkad_tkt_short");
        abort_code = RXKADPACKETSHORT;
-       if (skb_copy_bits(skb, sizeof(struct rxrpc_wire_header) + sizeof(*response),
-                         ticket, ticket_len) < 0)
+       ret = skb_copy_bits(skb, sizeof(struct rxrpc_wire_header) + sizeof(*response),
+                           ticket, ticket_len);
+       if (ret < 0)
+               goto temporary_error_free_ticket;
 
        ret = rxkad_decrypt_ticket(conn, server_key, skb, ticket, ticket_len,
                                   &session_key, &expiry, _abort_code);