netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] rxrpc: Fix return from none_validate_challenge()
@ 2025-05-27 15:01 David Howells
  2025-05-28 16:26 ` Simon Horman
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: David Howells @ 2025-05-27 15:01 UTC (permalink / raw)
  To: netdev
  Cc: dhowells, Dan Carpenter, Marc Dionne, Jakub Kicinski,
	David S. Miller, Eric Dumazet, Paolo Abeni, Simon Horman,
	linux-afs, linux-kernel

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 <dan.carpenter@linaro.org>
Closes: https://lists.infradead.org/pipermail/linux-afs/2025-April/009738.html
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Jakub Kicinski <kuba@kernel.org>
cc: "David S. Miller" <davem@davemloft.net>
cc: Eric Dumazet <edumazet@google.com>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: netdev@vger.kernel.org
---
 net/rxrpc/insecure.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/rxrpc/insecure.c b/net/rxrpc/insecure.c
index 1f7c136d6d0e..0a260df45d25 100644
--- a/net/rxrpc/insecure.c
+++ b/net/rxrpc/insecure.c
@@ -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,


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] rxrpc: Fix return from none_validate_challenge()
  2025-05-27 15:01 [PATCH net-next] rxrpc: Fix return from none_validate_challenge() David Howells
@ 2025-05-28 16:26 ` Simon Horman
  2025-05-29  6:47 ` Paolo Abeni
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2025-05-28 16:26 UTC (permalink / raw)
  To: David Howells
  Cc: netdev, Dan Carpenter, Marc Dionne, Jakub Kicinski,
	David S. Miller, Eric Dumazet, Paolo Abeni, linux-afs,
	linux-kernel

On Tue, May 27, 2025 at 04:01:43PM +0100, David Howells 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).
> 
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lists.infradead.org/pipermail/linux-afs/2025-April/009738.html
> Signed-off-by: David Howells <dhowells@redhat.com>

...

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] rxrpc: Fix return from none_validate_challenge()
  2025-05-27 15:01 [PATCH net-next] rxrpc: Fix return from none_validate_challenge() David Howells
  2025-05-28 16:26 ` Simon Horman
@ 2025-05-29  6:47 ` Paolo Abeni
  2025-05-29  7:36 ` David Howells
  2025-05-29 10:10 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Abeni @ 2025-05-29  6:47 UTC (permalink / raw)
  To: David Howells, netdev
  Cc: Dan Carpenter, Marc Dionne, Jakub Kicinski, David S. Miller,
	Eric Dumazet, Simon Horman, linux-afs, linux-kernel

On 5/27/25 5:01 PM, David Howells 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).
> 
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lists.infradead.org/pipermail/linux-afs/2025-April/009738.html
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Marc Dionne <marc.dionne@auristor.com>
> cc: Jakub Kicinski <kuba@kernel.org>
> cc: "David S. Miller" <davem@davemloft.net>
> cc: Eric Dumazet <edumazet@google.com>
> cc: Paolo Abeni <pabeni@redhat.com>
> cc: Simon Horman <horms@kernel.org>
> cc: linux-afs@lists.infradead.org
> cc: netdev@vger.kernel.org

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] rxrpc: Fix return from none_validate_challenge()
  2025-05-27 15:01 [PATCH net-next] rxrpc: Fix return from none_validate_challenge() David Howells
  2025-05-28 16:26 ` Simon Horman
  2025-05-29  6:47 ` Paolo Abeni
@ 2025-05-29  7:36 ` David Howells
  2025-05-29 10:10 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: David Howells @ 2025-05-29  7:36 UTC (permalink / raw)
  To: Paolo Abeni
  Cc: dhowells, netdev, Dan Carpenter, Marc Dionne, Jakub Kicinski,
	David S. Miller, Eric Dumazet, Simon Horman, linux-afs,
	linux-kernel

Paolo Abeni <pabeni@redhat.com> wrote:

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

> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] rxrpc: Fix return from none_validate_challenge()
  2025-05-27 15:01 [PATCH net-next] rxrpc: Fix return from none_validate_challenge() David Howells
                   ` (2 preceding siblings ...)
  2025-05-29  7:36 ` David Howells
@ 2025-05-29 10:10 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-05-29 10:10 UTC (permalink / raw)
  To: David Howells
  Cc: netdev, dan.carpenter, marc.dionne, kuba, davem, edumazet, pabeni,
	horms, linux-afs, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-05-29 10:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27 15:01 [PATCH net-next] rxrpc: Fix return from none_validate_challenge() David Howells
2025-05-28 16:26 ` Simon Horman
2025-05-29  6:47 ` Paolo Abeni
2025-05-29  7:36 ` David Howells
2025-05-29 10:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).