[PATCH net 1/2] rxrpc: Fix a race between socket set up and I/O thread creation

Eric Dumazet edumazet at google.com
Tue Oct 1 06:28:57 PDT 2024


On Tue, Oct 1, 2024 at 3:27 PM David Howells <dhowells at redhat.com> wrote:
>
> In rxrpc_open_socket(), it sets up the socket and then sets up the I/O
> thread that will handle it.  This is a problem, however, as there's a gap
> between the two phases in which a packet may come into rxrpc_encap_rcv()
> from the UDP packet but we oops when trying to wake the not-yet created I/O
> thread.
>
> As a quick fix, just make rxrpc_encap_rcv() discard the packet if there's
> no I/O thread yet.
>
> A better, but more intrusive fix would perhaps be to rearrange things such
> that the socket creation is done by the I/O thread.
>
> Fixes: a275da62e8c1 ("rxrpc: Create a per-local endpoint receive queue and I/O thread")
> Signed-off-by: David Howells <dhowells at redhat.com>

Reviewed-by: Eric Dumazet <edumazet at google.com>



More information about the linux-afs mailing list