Re: [PATCH] rxrpc: Initialize sockaddr_rxrpc directly

From: David Howells
Date: Mon Nov 18 2024 - 10:00:44 EST


Matt Jan <zoo868e@xxxxxxxxx> wrote:

> In rxrpc_lookup_peer_local_rcu(), removed the redundant memset call
> that zeros out the sockaddr_rxrpc structure before setting its fields.
> Instead, initialize the sockaddr_rxrpc structure directly in
> rxrpc_input_error().
>
> This change simplifies the code and ensures that the sockaddr_rxrpc
> structure is properly zero-initialized.

How does that actually fix the issue?

All the patch does is move the initialisation of srx from
rxrpc_lookup_peer_local_rcu() into its only caller - and nothing samples the
contents of srx between.

Looking at the bug report, the history of the uninitialised location goes back
further, to a network address generated/assembled in the ipv6 stack or from
the transmission side of the rxrpc stack, possibly call->peer->srx.transport.

David