Skip to contentSkip to conversation

rxrpc: Fix return from none_validate_challenge()

PATCH Applied David Howells 4 participants 5 messages May 27, 2025 – May 29, 2025

Subsystems (3)
lore
Share & tools
lore

David Howells

author maintainer
#0 lore raw

PATCH 1/1 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).

---
 net/rxrpc/insecure.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
net/rxrpc/insecure.c +3 -2
index 1f7c136d6d0e..0a260df45d25 100644
@@ -45,8 +45,9 @@ static void none_free_call_crypto(struct rxrpc_call *call)
 static bool none_validate_challenge(struct rxrpc_connection *conn,
 				    struct sk_buff *skb)
 {
-	return rxrpc_abort_conn(conn, skb, RX_PROTOCOL_ERROR, -EPROTO,
-				rxrpc_eproto_rxnull_challenge);
+	rxrpc_abort_conn(conn, skb, RX_PROTOCOL_ERROR, -EPROTO,
+			 rxrpc_eproto_rxnull_challenge);
+	return true;
 }
 
 static int none_sendmsg_respond_to_challenge(struct sk_buff *challenge,
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · David Howells

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).

...

maintainer
#2 lore raw
In reply to David Howells
Quoted 9 lines · David Howells

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).

Quoted 11 lines

net-next is closed for the merge window, but this is actually a fix for code that is already in net (since Linus pulled and the trees are forwarded).

We can apply it to net, no need to repost, but could you please provided a suitable Fixes tag?

Thanks!

Paolo

author maintainer
#3 lore raw
Quoted 3 lines · Paolo Abeni

net-next is closed for the merge window, but this is actually a fix for code that is already in net (since Linus pulled and the trees are forwarded).

Yeah - it wasn't pulled yet when I posted it.

Quoted 2 lines

We can apply it to net, no need to repost, but could you please provided a suitable Fixes tag?

Fixes 5800b1cf3fd8 ("rxrpc: Allow CHALLENGEs to the passed to the app for a RESPONSE")

Thanks,
David

#4 lore raw
In reply to David Howells
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:

Quoted 10 lines · On Tue, 27 May 2025 16:01:43 +0100 you wrote:

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).

[...]

Here is the summary with links:
- [net-next] rxrpc: Fix return from none_validate_challenge()

    https://git.kernel.org/netdev/net/c/fd579a2ebbe4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html