History

rxrpc: Trace protocol errors in received packets

Add a tracepoint (rxrpc_rx_proto) to record protocol errors in received packets. The following changes are made: (1) Add a function, __rxrpc_abort_eproto(), to note a protocol error on a call and mark the call aborted. This is wrapped by rxrpc_abort_eproto() that makes the why string usable in trace. (2) Add trace_rxrpc_rx_proto() or rxrpc_abort_eproto() to protocol error generation points, replacing rxrpc_abort_call() with the latter. (3) Only send an abort packet in rxkad_verify_packet*() if we actually managed to abort the call. Note that a trace event is also emitted if a kernel user (e.g. afs) tries to send data through a call when it's not in the transmission phase, though it's not technically a receive event.

David Howells committed 9 years ago

Commit fb46f6e1 parent ef686228 files · +138 −40Browse files

Unified · Split

8 files
  1. include/trace/events/rxrpc.h +24 −0
  2. net/rxrpc/ar-internal.h +19 −0
  3. net/rxrpc/conn_event.c +6 −3
  4. net/rxrpc/input.c +4 −1
  5. net/rxrpc/insecure.c +8 −2
  6. net/rxrpc/recvmsg.c +2 −0
  7. net/rxrpc/rxkad.c +73 −33
  8. net/rxrpc/sendmsg.c +2 −1
include/trace/events/rxrpc.h+24−0
@@ -1087,6 +1087,30 @@ TRACE_EVENT(rxrpc_improper_term, · 1086 unmodified lines
10871087 __entry->abort_code)
10881088 );
10891089
1090+TRACE_EVENT(rxrpc_rx_eproto,
1091+ TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
1092+ const char *why),
1093+
1094+ TP_ARGS(call, serial, why),
1095+
1096+ TP_STRUCT__entry(
1097+ __field(struct rxrpc_call *, call )
1098+ __field(rxrpc_serial_t, serial )
1099+ __field(const char *, why )
1100+ ),
1101+
1102+ TP_fast_assign(
1103+ __entry->call = call;
1104+ __entry->serial = serial;
1105+ __entry->why = why;
1106+ ),
1107+
1108+ TP_printk("c=%p EPROTO %08x %s",
1109+ __entry->call,
1110+ __entry->serial,
1111+ __entry->why)
1112+ );
1113+
10901114 #endif /* _TRACE_RXRPC_H */
10911115
10921116 /* This part must be outside protection */
net/rxrpc/ar-internal.h+19−0
@@ -739,6 +739,25 @@ static inline bool rxrpc_abort_call(const char *why, struct rxrpc_call *call, · 738 unmodified lines
739739 return ret;
740740 }
741741
742+/*
743+ * Abort a call due to a protocol error.
744+ */
745+static inline bool __rxrpc_abort_eproto(struct rxrpc_call *call,
746+ struct sk_buff *skb,
747+ const char *eproto_why,
748+ const char *why,
749+ u32 abort_code)
750+{
751+ struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
752+
753+ trace_rxrpc_rx_eproto(call, sp->hdr.serial, eproto_why);
754+ return rxrpc_abort_call(why, call, sp->hdr.seq, abort_code, -EPROTO);
755+}
756+
757+#define rxrpc_abort_eproto(call, skb, eproto_why, abort_why, abort_code) \
758+ __rxrpc_abort_eproto((call), (skb), tracepoint_string(eproto_why), \
759+ (abort_why), (abort_code))
760+
742761 /*
743762 * conn_client.c
744763 */
net/rxrpc/conn_event.c+6−3
@@ -281,8 +281,11 @@ static int rxrpc_process_event(struct rxrpc_connection *conn, · 280 unmodified lines
281281
282282 case RXRPC_PACKET_TYPE_ABORT:
283283 if (skb_copy_bits(skb, sizeof(struct rxrpc_wire_header),
284− &wtmp, sizeof(wtmp)) < 0)
284+ &wtmp, sizeof(wtmp)) < 0) {
285+ trace_rxrpc_rx_eproto(NULL, sp->hdr.serial,
286+ tracepoint_string("bad_abort"));
285287 return -EPROTO;
288+ }
286289 abort_code = ntohl(wtmp);
287290 _proto("Rx ABORT %%%u { ac=%d }", sp->hdr.serial, abort_code);
288291
@@ -327,7 +330,8 @@ static int rxrpc_process_event(struct rxrpc_connection *conn, · 38 unmodified lines
327330 return 0;
328331
329332 default:
330− _leave(" = -EPROTO [%u]", sp->hdr.type);
333+ trace_rxrpc_rx_eproto(NULL, sp->hdr.serial,
334+ tracepoint_string("bad_conn_pkt"));
331335 return -EPROTO;
332336 }
333337 }
@@ -422,6 +426,5 @@ protocol_error: · 88 unmodified lines
422426 if (rxrpc_abort_connection(conn, ret, abort_code) < 0)
423427 goto requeue_and_leave;
424428 rxrpc_free_skb(skb, rxrpc_skb_rx_freed);
425− _leave(" [EPROTO]");
426429 goto out;
427430 }
net/rxrpc/input.c+4−1
@@ -1017,8 +1017,11 @@ int rxrpc_extract_header(struct rxrpc_skb_priv *sp, struct sk_buff *skb) · 1016 unmodified lines
10171017 struct rxrpc_wire_header whdr;
10181018
10191019 /* dig out the RxRPC connection details */
1020− if (skb_copy_bits(skb, 0, &whdr, sizeof(whdr)) < 0)
1020+ if (skb_copy_bits(skb, 0, &whdr, sizeof(whdr)) < 0) {
1021+ trace_rxrpc_rx_eproto(NULL, sp->hdr.serial,
1022+ tracepoint_string("bad_hdr"));
10211023 return -EBADMSG;
1024+ }
10221025
10231026 memset(sp, 0, sizeof(*sp));
10241027 sp->hdr.epoch = ntohl(whdr.epoch);
net/rxrpc/insecure.c+8−2
@@ -46,7 +46,10 @@ static int none_respond_to_challenge(struct rxrpc_connection *conn, · 45 unmodified lines
4646 struct sk_buff *skb,
4747 u32 *_abort_code)
4848 {
49− *_abort_code = RX_PROTOCOL_ERROR;
49+ struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
50+
51+ trace_rxrpc_rx_eproto(NULL, sp->hdr.serial,
52+ tracepoint_string("chall_none"));
5053 return -EPROTO;
5154 }
5255
@@ -54,7 +57,10 @@ static int none_verify_response(struct rxrpc_connection *conn, · 1 unmodified line
5457 struct sk_buff *skb,
5558 u32 *_abort_code)
5659 {
57− *_abort_code = RX_PROTOCOL_ERROR;
60+ struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
61+
62+ trace_rxrpc_rx_eproto(NULL, sp->hdr.serial,
63+ tracepoint_string("resp_none"));
5864 return -EPROTO;
5965 }
6066
net/rxrpc/recvmsg.c+2−0
@@ -682,9 +682,11 @@ out: · 681 unmodified lines
682682 return ret;
683683
684684 short_data:
685+ trace_rxrpc_rx_eproto(call, 0, tracepoint_string("short_data"));
685686 ret = -EBADMSG;
686687 goto out;
687688 excess_data:
689+ trace_rxrpc_rx_eproto(call, 0, tracepoint_string("excess_data"));
688690 ret = -EMSGSIZE;
689691 goto out;
690692 call_complete:
net/rxrpc/rxkad.c+73−33
@@ -148,15 +148,13 @@ static int rxkad_secure_packet_auth(const struct rxrpc_call *call, · 147 unmodified lines
148148 u32 data_size,
149149 void *sechdr)
150150 {
151− struct rxrpc_skb_priv *sp;
151+ struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
152152 SKCIPHER_REQUEST_ON_STACK(req, call->conn->cipher);
153153 struct rxkad_level1_hdr hdr;
154154 struct rxrpc_crypt iv;
155155 struct scatterlist sg;
156156 u16 check;
157157
158− sp = rxrpc_skb(skb);
159−
160158 _enter("");
161159
162160 check = sp->hdr.seq ^ call->call_id;
@@ -323,6 +321,7 @@ static int rxkad_verify_packet_1(struct rxrpc_call *call, struct sk_buff *skb, · 160 unmodified lines
323321 struct rxrpc_crypt iv;
324322 struct scatterlist sg[16];
325323 struct sk_buff *trailer;
324+ bool aborted;
326325 u32 data_size, buf;
327326 u16 check;
328327 int nsg;
@@ -330,7 +329,8 @@ static int rxkad_verify_packet_1(struct rxrpc_call *call, struct sk_buff *skb, · 1 unmodified line
330329 _enter("");
331330
332331 if (len < 8) {
333− rxrpc_abort_call("V1H", call, seq, RXKADSEALEDINCON, -EPROTO);
332+ aborted = rxrpc_abort_eproto(call, skb, "rxkad_1_hdr", "V1H",
333+ RXKADSEALEDINCON);
334334 goto protocol_error;
335335 }
336336
@@ -355,7 +355,8 @@ static int rxkad_verify_packet_1(struct rxrpc_call *call, struct sk_buff *skb, · 18 unmodified lines
355355
356356 /* Extract the decrypted packet length */
357357 if (skb_copy_bits(skb, offset, &sechdr, sizeof(sechdr)) < 0) {
358− rxrpc_abort_call("XV1", call, seq, RXKADDATALEN, -EPROTO);
358+ aborted = rxrpc_abort_eproto(call, skb, "rxkad_1_len", "XV1",
359+ RXKADDATALEN);
359360 goto protocol_error;
360361 }
361362 offset += sizeof(sechdr);
@@ -368,12 +369,14 @@ static int rxkad_verify_packet_1(struct rxrpc_call *call, struct sk_buff *skb, · 6 unmodified lines
368369 check ^= seq ^ call->call_id;
369370 check &= 0xffff;
370371 if (check != 0) {
371− rxrpc_abort_call("V1C", call, seq, RXKADSEALEDINCON, -EPROTO);
372+ aborted = rxrpc_abort_eproto(call, skb, "rxkad_1_check", "V1C",
373+ RXKADSEALEDINCON);
372374 goto protocol_error;
373375 }
374376
375377 if (data_size > len) {
376− rxrpc_abort_call("V1L", call, seq, RXKADDATALEN, -EPROTO);
378+ aborted = rxrpc_abort_eproto(call, skb, "rxkad_1_datalen", "V1L",
379+ RXKADDATALEN);
377380 goto protocol_error;
378381 }
379382
@@ -381,8 +384,8 @@ static int rxkad_verify_packet_1(struct rxrpc_call *call, struct sk_buff *skb, · 1 unmodified line
381384 return 0;
382385
383386 protocol_error:
384− rxrpc_send_abort_packet(call);
385− _leave(" = -EPROTO");
387+ if (aborted)
388+ rxrpc_send_abort_packet(call);
386389 return -EPROTO;
387390
388391 nomem:
@@ -403,6 +406,7 @@ static int rxkad_verify_packet_2(struct rxrpc_call *call, struct sk_buff *skb, · 14 unmodified lines
403406 struct rxrpc_crypt iv;
404407 struct scatterlist _sg[4], *sg;
405408 struct sk_buff *trailer;
409+ bool aborted;
406410 u32 data_size, buf;
407411 u16 check;
408412 int nsg;
@@ -410,7 +414,8 @@ static int rxkad_verify_packet_2(struct rxrpc_call *call, struct sk_buff *skb, · 1 unmodified line
410414 _enter(",{%d}", skb->len);
411415
412416 if (len < 8) {
413− rxrpc_abort_call("V2H", call, seq, RXKADSEALEDINCON, -EPROTO);
417+ aborted = rxrpc_abort_eproto(call, skb, "rxkad_2_hdr", "V2H",
418+ RXKADSEALEDINCON);
414419 goto protocol_error;
415420 }
416421
@@ -445,7 +450,8 @@ static int rxkad_verify_packet_2(struct rxrpc_call *call, struct sk_buff *skb, · 28 unmodified lines
445450
446451 /* Extract the decrypted packet length */
447452 if (skb_copy_bits(skb, offset, &sechdr, sizeof(sechdr)) < 0) {
448− rxrpc_abort_call("XV2", call, seq, RXKADDATALEN, -EPROTO);
453+ aborted = rxrpc_abort_eproto(call, skb, "rxkad_2_len", "XV2",
454+ RXKADDATALEN);
449455 goto protocol_error;
450456 }
451457 offset += sizeof(sechdr);
@@ -458,12 +464,14 @@ static int rxkad_verify_packet_2(struct rxrpc_call *call, struct sk_buff *skb, · 6 unmodified lines
458464 check ^= seq ^ call->call_id;
459465 check &= 0xffff;
460466 if (check != 0) {
461− rxrpc_abort_call("V2C", call, seq, RXKADSEALEDINCON, -EPROTO);
467+ aborted = rxrpc_abort_eproto(call, skb, "rxkad_2_check", "V2C",
468+ RXKADSEALEDINCON);
462469 goto protocol_error;
463470 }
464471
465472 if (data_size > len) {
466− rxrpc_abort_call("V2L", call, seq, RXKADDATALEN, -EPROTO);
473+ aborted = rxrpc_abort_eproto(call, skb, "rxkad_2_datalen", "V2L",
474+ RXKADDATALEN);
467475 goto protocol_error;
468476 }
469477
@@ -471,8 +479,8 @@ static int rxkad_verify_packet_2(struct rxrpc_call *call, struct sk_buff *skb, · 1 unmodified line
471479 return 0;
472480
473481 protocol_error:
474− rxrpc_send_abort_packet(call);
475− _leave(" = -EPROTO");
482+ if (aborted)
483+ rxrpc_send_abort_packet(call);
476484 return -EPROTO;
477485
478486 nomem:
@@ -491,6 +499,7 @@ static int rxkad_verify_packet(struct rxrpc_call *call, struct sk_buff *skb, · 12 unmodified lines
491499 SKCIPHER_REQUEST_ON_STACK(req, call->conn->cipher);
492500 struct rxrpc_crypt iv;
493501 struct scatterlist sg;
502+ bool aborted;
494503 u16 cksum;
495504 u32 x, y;
496505
@@ -522,10 +531,9 @@ static int rxkad_verify_packet(struct rxrpc_call *call, struct sk_buff *skb, · 25 unmodified lines
522531 cksum = 1; /* zero checksums are not permitted */
523532
524533 if (cksum != expected_cksum) {
525− rxrpc_abort_call("VCK", call, seq, RXKADSEALEDINCON, -EPROTO);
526− rxrpc_send_abort_packet(call);
527− _leave(" = -EPROTO [csum failed]");
528− return -EPROTO;
534+ aborted = rxrpc_abort_eproto(call, skb, "rxkad_csum", "VCK",
535+ RXKADSEALEDINCON);
536+ goto protocol_error;
529537 }
530538
531539 switch (call->conn->params.security_level) {
@@ -538,6 +546,11 @@ static int rxkad_verify_packet(struct rxrpc_call *call, struct sk_buff *skb, · 6 unmodified lines
538546 default:
539547 return -ENOANO;
540548 }
549+
550+protocol_error:
551+ if (aborted)
552+ rxrpc_send_abort_packet(call);
553+ return -EPROTO;
541554 }
542555
543556 /*
@@ -754,11 +767,13 @@ static int rxkad_respond_to_challenge(struct rxrpc_connection *conn, · 210 unmodified lines
754767 struct rxkad_response resp
755768 __attribute__((aligned(8))); /* must be aligned for crypto */
756769 struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
770+ const char *eproto;
757771 u32 version, nonce, min_level, abort_code;
758772 int ret;
759773
760774 _enter("{%d,%x}", conn->debug_id, key_serial(conn->params.key));
761775
776+ eproto = tracepoint_string("chall_no_key");
762777 abort_code = RX_PROTOCOL_ERROR;
763778 if (!conn->params.key)
764779 goto protocol_error;
@@ -768,6 +783,7 @@ static int rxkad_respond_to_challenge(struct rxrpc_connection *conn, · 3 unmodified lines
768783 if (ret < 0)
769784 goto other_error;
770785
786+ eproto = tracepoint_string("chall_short");
771787 abort_code = RXKADPACKETSHORT;
772788 if (skb_copy_bits(skb, sizeof(struct rxrpc_wire_header),
773789 &challenge, sizeof(challenge)) < 0)
@@ -780,6 +796,7 @@ static int rxkad_respond_to_challenge(struct rxrpc_connection *conn, · 6 unmodified lines
780796 _proto("Rx CHALLENGE %%%u { v=%u n=%u ml=%u }",
781797 sp->hdr.serial, version, nonce, min_level);
782798
799+ eproto = tracepoint_string("chall_ver");
783800 abort_code = RXKADINCONSISTENCY;
784801 if (version != RXKAD_VERSION)
785802 goto protocol_error;
@@ -814,6 +831,7 @@ static int rxkad_respond_to_challenge(struct rxrpc_connection *conn, · 28 unmodified lines
814831 return rxkad_send_response(conn, &sp->hdr, &resp, token->kad);
815832
816833 protocol_error:
834+ trace_rxrpc_rx_eproto(NULL, sp->hdr.serial, eproto);
817835 ret = -EPROTO;
818836 other_error:
819837 *_abort_code = abort_code;
@@ -824,19 +842,23 @@ other_error: · 4 unmodified lines
824842 * decrypt the kerberos IV ticket in the response
825843 */
826844 static int rxkad_decrypt_ticket(struct rxrpc_connection *conn,
845+ struct sk_buff *skb,
827846 void *ticket, size_t ticket_len,
828847 struct rxrpc_crypt *_session_key,
829848 time_t *_expiry,
830849 u32 *_abort_code)
831850 {
832851 struct skcipher_request *req;
852+ struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
833853 struct rxrpc_crypt iv, key;
834854 struct scatterlist sg[1];
835855 struct in_addr addr;
836856 unsigned int life;
857+ const char *eproto;
837858 time_t issue, now;
838859 bool little_endian;
839860 int ret;
861+ u32 abort_code;
840862 u8 *p, *q, *name, *end;
841863
842864 _enter("{%d},{%x}", conn->debug_id, key_serial(conn->server_key));
@@ -847,10 +869,10 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn, · 4 unmodified lines
847869 if (ret < 0) {
848870 switch (ret) {
849871 case -EKEYEXPIRED:
850− *_abort_code = RXKADEXPIRED;
872+ abort_code = RXKADEXPIRED;
851873 goto other_error;
852874 default:
853− *_abort_code = RXKADNOAUTH;
875+ abort_code = RXKADNOAUTH;
854876 goto other_error;
855877 }
856878 }
@@ -875,11 +897,12 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn, · 18 unmodified lines
875897 p = ticket;
876898 end = p + ticket_len;
877899
878−#define Z(size) \
900+#define Z(field) \
879901 ({ \
880902 u8 *__str = p; \
903+ eproto = tracepoint_string("rxkad_bad_"#field); \
881904 q = memchr(p, 0, end - p); \
882− if (!q || q - p > (size)) \
905+ if (!q || q - p > (field##_SZ)) \
883906 goto bad_ticket; \
884907 for (; p < q; p++) \
885908 if (!isprint(*p)) \
@@ -894,17 +917,18 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn, · 8 unmodified lines
894917 p++;
895918
896919 /* extract the authentication name */
897− name = Z(ANAME_SZ);
920+ name = Z(ANAME);
898921 _debug("KIV ANAME: %s", name);
899922
900923 /* extract the principal's instance */
901− name = Z(INST_SZ);
924+ name = Z(INST);
902925 _debug("KIV INST : %s", name);
903926
904927 /* extract the principal's authentication domain */
905− name = Z(REALM_SZ);
928+ name = Z(REALM);
906929 _debug("KIV REALM: %s", name);
907930
931+ eproto = tracepoint_string("rxkad_bad_len");
908932 if (end - p < 4 + 8 + 4 + 2)
909933 goto bad_ticket;
910934
@@ -939,13 +963,13 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn, · 28 unmodified lines
939963
940964 /* check the ticket is in date */
941965 if (issue > now) {
942− *_abort_code = RXKADNOAUTH;
966+ abort_code = RXKADNOAUTH;
943967 ret = -EKEYREJECTED;
944968 goto other_error;
945969 }
946970
947971 if (issue < now - life) {
948− *_abort_code = RXKADEXPIRED;
972+ abort_code = RXKADEXPIRED;
949973 ret = -EKEYEXPIRED;
950974 goto other_error;
951975 }
@@ -953,18 +977,20 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn, · 1 unmodified line
953977 *_expiry = issue + life;
954978
955979 /* get the service name */
956− name = Z(SNAME_SZ);
980+ name = Z(SNAME);
957981 _debug("KIV SNAME: %s", name);
958982
959983 /* get the service instance name */
960− name = Z(INST_SZ);
984+ name = Z(INST);
961985 _debug("KIV SINST: %s", name);
962986 return 0;
963987
964988 bad_ticket:
965− *_abort_code = RXKADBADTICKET;
989+ trace_rxrpc_rx_eproto(NULL, sp->hdr.serial, eproto);
990+ abort_code = RXKADBADTICKET;
966991 ret = -EPROTO;
967992 other_error:
993+ *_abort_code = abort_code;
968994 return ret;
969995 temporary_error:
970996 return ret;
@@ -1017,6 +1043,7 @@ static int rxkad_verify_response(struct rxrpc_connection *conn, · 46 unmodified lines
10171043 __attribute__((aligned(8))); /* must be aligned for crypto */
10181044 struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
10191045 struct rxrpc_crypt session_key;
1046+ const char *eproto;
10201047 time_t expiry;
10211048 void *ticket;
10221049 u32 abort_code, version, kvno, ticket_len, level;
@@ -1025,6 +1052,7 @@ static int rxkad_verify_response(struct rxrpc_connection *conn, · 2 unmodified lines
10251052
10261053 _enter("{%d,%x}", conn->debug_id, key_serial(conn->server_key));
10271054
1055+ eproto = tracepoint_string("rxkad_rsp_short");
10281056 abort_code = RXKADPACKETSHORT;
10291057 if (skb_copy_bits(skb, sizeof(struct rxrpc_wire_header),
10301058 &response, sizeof(response)) < 0)
@@ -1038,14 +1066,17 @@ static int rxkad_verify_response(struct rxrpc_connection *conn, · 7 unmodified lines
10381066 _proto("Rx RESPONSE %%%u { v=%u kv=%u tl=%u }",
10391067 sp->hdr.serial, version, kvno, ticket_len);
10401068
1069+ eproto = tracepoint_string("rxkad_rsp_ver");
10411070 abort_code = RXKADINCONSISTENCY;
10421071 if (version != RXKAD_VERSION)
10431072 goto protocol_error;
10441073
1074+ eproto = tracepoint_string("rxkad_rsp_tktlen");
10451075 abort_code = RXKADTICKETLEN;
10461076 if (ticket_len < 4 || ticket_len > MAXKRB5TICKETLEN)
10471077 goto protocol_error;
10481078
1079+ eproto = tracepoint_string("rxkad_rsp_unkkey");
10491080 abort_code = RXKADUNKNOWNKEY;
10501081 if (kvno >= RXKAD_TKT_TYPE_KERBEROS_V5)
10511082 goto protocol_error;
@@ -1056,12 +1087,13 @@ static int rxkad_verify_response(struct rxrpc_connection *conn, · 4 unmodified lines
10561087 if (!ticket)
10571088 goto temporary_error;
10581089
1090+ eproto = tracepoint_string("rxkad_tkt_short");
10591091 abort_code = RXKADPACKETSHORT;
10601092 if (skb_copy_bits(skb, sizeof(struct rxrpc_wire_header),
10611093 ticket, ticket_len) < 0)
10621094 goto protocol_error_free;
10631095
1064− ret = rxkad_decrypt_ticket(conn, ticket, ticket_len, &session_key,
1096+ ret = rxkad_decrypt_ticket(conn, skb, ticket, ticket_len, &session_key,
10651097 &expiry, _abort_code);
10661098 if (ret < 0)
10671099 goto temporary_error_free;
@@ -1070,6 +1102,7 @@ static int rxkad_verify_response(struct rxrpc_connection *conn, · 2 unmodified lines
10701102 * response */
10711103 rxkad_decrypt_response(conn, &response, &session_key);
10721104
1105+ eproto = tracepoint_string("rxkad_rsp_param");
10731106 abort_code = RXKADSEALEDINCON;
10741107 if (ntohl(response.encrypted.epoch) != conn->proto.epoch)
10751108 goto protocol_error_free;
@@ -1080,6 +1113,7 @@ static int rxkad_verify_response(struct rxrpc_connection *conn, · 4 unmodified lines
10801113 csum = response.encrypted.checksum;
10811114 response.encrypted.checksum = 0;
10821115 rxkad_calc_response_checksum(&response);
1116+ eproto = tracepoint_string("rxkad_rsp_csum");
10831117 if (response.encrypted.checksum != csum)
10841118 goto protocol_error_free;
10851119
@@ -1088,11 +1122,15 @@ static int rxkad_verify_response(struct rxrpc_connection *conn, · 2 unmodified lines
10881122 struct rxrpc_call *call;
10891123 u32 call_id = ntohl(response.encrypted.call_id[i]);
10901124
1125+ eproto = tracepoint_string("rxkad_rsp_callid");
10911126 if (call_id > INT_MAX)
10921127 goto protocol_error_unlock;
10931128
1129+ eproto = tracepoint_string("rxkad_rsp_callctr");
10941130 if (call_id < conn->channels[i].call_counter)
10951131 goto protocol_error_unlock;
1132+
1133+ eproto = tracepoint_string("rxkad_rsp_callst");
10961134 if (call_id > conn->channels[i].call_counter) {
10971135 call = rcu_dereference_protected(
10981136 conn->channels[i].call,
@@ -1104,10 +1142,12 @@ static int rxkad_verify_response(struct rxrpc_connection *conn, · 5 unmodified lines
11041142 }
11051143 spin_unlock(&conn->channel_lock);
11061144
1145+ eproto = tracepoint_string("rxkad_rsp_seq");
11071146 abort_code = RXKADOUTOFSEQUENCE;
11081147 if (ntohl(response.encrypted.inc_nonce) != conn->security_nonce + 1)
11091148 goto protocol_error_free;
11101149
1150+ eproto = tracepoint_string("rxkad_rsp_level");
11111151 abort_code = RXKADLEVELFAIL;
11121152 level = ntohl(response.encrypted.level);
11131153 if (level > RXRPC_SECURITY_ENCRYPT)
@@ -1130,8 +1170,8 @@ protocol_error_unlock: · 16 unmodified lines
11301170 protocol_error_free:
11311171 kfree(ticket);
11321172 protocol_error:
1173+ trace_rxrpc_rx_eproto(NULL, sp->hdr.serial, eproto);
11331174 *_abort_code = abort_code;
1134− _leave(" = -EPROTO [%d]", abort_code);
11351175 return -EPROTO;
11361176
11371177 temporary_error_free:
net/rxrpc/sendmsg.c+2−1
@@ -623,7 +623,8 @@ int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call, · 622 unmodified lines
623623 read_unlock_bh(&call->state_lock);
624624 break;
625625 default:
626− /* Request phase complete for this client call */
626+ /* Request phase complete for this client call */
627+ trace_rxrpc_rx_eproto(call, 0, tracepoint_string("late_send"));
627628 ret = -EPROTO;
628629 break;
629630 }