Skip to content

Commit 0422e7a

Browse files
dhowellskuba-moo
authored andcommitted
rxrpc: Fix re-decryption of RESPONSE packets
If a RESPONSE packet gets a temporary failure during processing, it may end up in a partially decrypted state - and then get requeued for a retry. Fix this by just discarding the packet; we will send another CHALLENGE packet and thereby elicit a further response. Similarly, discard an incoming CHALLENGE packet if we get an error whilst generating a RESPONSE; the server will send another CHALLENGE. Fixes: 17926a7 ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both") Closes: https://sashiko.dev/#/patchset/[email protected] Signed-off-by: David Howells <[email protected]> cc: Marc Dionne <[email protected]> cc: Jeffrey Altman <[email protected]> cc: Simon Horman <[email protected]> cc: [email protected] cc: [email protected] Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 55b2984 commit 0422e7a

2 files changed

Lines changed: 2 additions & 13 deletions

File tree

include/trace/events/rxrpc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@
285285
EM(rxrpc_conn_put_unidle, "PUT unidle ") \
286286
EM(rxrpc_conn_put_work, "PUT work ") \
287287
EM(rxrpc_conn_queue_challenge, "QUE chall ") \
288-
EM(rxrpc_conn_queue_retry_work, "QUE retry-wk") \
289288
EM(rxrpc_conn_queue_rx_work, "QUE rx-work ") \
290289
EM(rxrpc_conn_see_new_service_conn, "SEE new-svc ") \
291290
EM(rxrpc_conn_see_reap_service, "SEE reap-svc") \

net/rxrpc/conn_event.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ void rxrpc_process_delayed_final_acks(struct rxrpc_connection *conn, bool force)
389389
static void rxrpc_do_process_connection(struct rxrpc_connection *conn)
390390
{
391391
struct sk_buff *skb;
392-
int ret;
393392

394393
if (test_and_clear_bit(RXRPC_CONN_EV_CHALLENGE, &conn->events))
395394
rxrpc_secure_connection(conn);
@@ -398,17 +397,8 @@ static void rxrpc_do_process_connection(struct rxrpc_connection *conn)
398397
* connection that each one has when we've finished with it */
399398
while ((skb = skb_dequeue(&conn->rx_queue))) {
400399
rxrpc_see_skb(skb, rxrpc_skb_see_conn_work);
401-
ret = rxrpc_process_event(conn, skb);
402-
switch (ret) {
403-
case -ENOMEM:
404-
case -EAGAIN:
405-
skb_queue_head(&conn->rx_queue, skb);
406-
rxrpc_queue_conn(conn, rxrpc_conn_queue_retry_work);
407-
break;
408-
default:
409-
rxrpc_free_skb(skb, rxrpc_skb_put_conn_work);
410-
break;
411-
}
400+
rxrpc_process_event(conn, skb);
401+
rxrpc_free_skb(skb, rxrpc_skb_put_conn_work);
412402
}
413403
}
414404

0 commit comments

Comments
 (0)