Skip to content

Commit fd579a2

Browse files
dhowellsPaolo Abeni
authored andcommitted
rxrpc: Fix return from none_validate_challenge()
Fix the return value of none_validate_challenge() to be explicitly true (which indicates the source packet should simply be discarded) rather than implicitly true (because rxrpc_abort_conn() always returns -EPROTO which gets converted to true). Note that this change doesn't change the behaviour of the code (which is correct by accident) and, in any case, we *shouldn't* get a CHALLENGE packet to an rxnull connection (ie. no security). Reported-by: Dan Carpenter <[email protected]> Closes: https://lists.infradead.org/pipermail/linux-afs/2025-April/009738.html Signed-off-by: David Howells <[email protected]> cc: Marc Dionne <[email protected]> cc: Jakub Kicinski <[email protected]> cc: "David S. Miller" <[email protected]> cc: Eric Dumazet <[email protected]> cc: Paolo Abeni <[email protected]> cc: Simon Horman <[email protected]> cc: [email protected] cc: [email protected] Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Fixes: 5800b1c ("rxrpc: Allow CHALLENGEs to the passed to the app for a RESPONSE") Signed-off-by: Paolo Abeni <[email protected]>
1 parent f41a94a commit fd579a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/rxrpc/insecure.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ static void none_free_call_crypto(struct rxrpc_call *call)
4545
static bool none_validate_challenge(struct rxrpc_connection *conn,
4646
struct sk_buff *skb)
4747
{
48-
return rxrpc_abort_conn(conn, skb, RX_PROTOCOL_ERROR, -EPROTO,
49-
rxrpc_eproto_rxnull_challenge);
48+
rxrpc_abort_conn(conn, skb, RX_PROTOCOL_ERROR, -EPROTO,
49+
rxrpc_eproto_rxnull_challenge);
50+
return true;
5051
}
5152

5253
static int none_sendmsg_respond_to_challenge(struct sk_buff *challenge,

0 commit comments

Comments
 (0)