diff options
| author | David Howells <dhowells@redhat.com> | 2025-04-11 10:52:56 +0100 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-04-14 17:36:42 -0700 |
| commit | d03539d5c2dec9b028297c15e57bd3c01d0d9c0d (patch) | |
| tree | 0e2650b0093fb7b36af987395398ad2d75f4d218 /net/rxrpc | |
| parent | b794dc17cdd0517edb377edf863c2dc1f2dec781 (diff) | |
| download | linux-d03539d5c2dec9b028297c15e57bd3c01d0d9c0d.tar.gz linux-d03539d5c2dec9b028297c15e57bd3c01d0d9c0d.tar.bz2 linux-d03539d5c2dec9b028297c15e57bd3c01d0d9c0d.zip | |
rxrpc: Display security params in the afs_cb_call tracepoint
Make the afs_cb_call tracepoint display some security parameters to make
debugging easier.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20250411095303.2316168-12-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/rxrpc')
| -rw-r--r-- | net/rxrpc/ar-internal.h | 1 | ||||
| -rw-r--r-- | net/rxrpc/call_object.c | 20 | ||||
| -rw-r--r-- | net/rxrpc/rxgk.c | 2 |
3 files changed, 23 insertions, 0 deletions
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index fd235bfa226d..ca62a1db3286 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h @@ -740,6 +740,7 @@ struct rxrpc_call { u32 call_id; /* call ID on connection */ u32 cid; /* connection ID plus channel index */ u32 security_level; /* Security level selected */ + u32 security_enctype; /* Security-specific encoding type (or 0) */ int debug_id; /* debug ID for printks */ unsigned short rx_pkt_offset; /* Current recvmsg packet offset */ unsigned short rx_pkt_len; /* Current recvmsg packet len */ diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c index fc88ffe1b050..e9e8f0ef3fd5 100644 --- a/net/rxrpc/call_object.c +++ b/net/rxrpc/call_object.c @@ -760,3 +760,23 @@ void rxrpc_destroy_all_calls(struct rxrpc_net *rxnet) atomic_dec(&rxnet->nr_calls); wait_var_event(&rxnet->nr_calls, !atomic_read(&rxnet->nr_calls)); } + +/** + * rxrpc_kernel_query_call_security - Query call's security parameters + * @call: The call to query + * @_service_id: Where to return the service ID + * @_enctype: Where to return the "encoding type" + * + * This queries the security parameters of a call, setting *@_service_id and + * *@_enctype and returning the security class. + * + * Return: The security class protocol number. + */ +u8 rxrpc_kernel_query_call_security(struct rxrpc_call *call, + u16 *_service_id, u32 *_enctype) +{ + *_service_id = call->dest_srx.srx_service; + *_enctype = call->security_enctype; + return call->security_ix; +} +EXPORT_SYMBOL(rxrpc_kernel_query_call_security); diff --git a/net/rxrpc/rxgk.c b/net/rxrpc/rxgk.c index 8b1ccdf8bc58..6175fc54ba90 100644 --- a/net/rxrpc/rxgk.c +++ b/net/rxrpc/rxgk.c @@ -443,6 +443,7 @@ static int rxgk_secure_packet(struct rxrpc_call *call, struct rxrpc_txbuf *txb) if (ret < 0) return ret; + call->security_enctype = gk->krb5->etype; txb->cksum = htons(gk->key_number); switch (call->conn->security_level) { @@ -590,6 +591,7 @@ static int rxgk_verify_packet(struct rxrpc_call *call, struct sk_buff *skb) } } + call->security_enctype = gk->krb5->etype; switch (call->conn->security_level) { case RXRPC_SECURITY_PLAIN: return 0; |
