Re: [PATCH net v1] rxrpc: fix io_thread race in rxrpc_wake_up_io_thread()
From: Simon Horman
Date: Wed Jul 15 2026 - 07:45:06 EST
On Wed, Jul 08, 2026 at 05:35:34PM +0800, xuanqiang.luo@xxxxxxxxx wrote:
> From: Xuanqiang Luo <luoxuanqiang@xxxxxxxxxx>
>
> rxrpc_wake_up_io_thread() checks local->io_thread before waking it, but
> then reloads the pointer for wake_up_process().
>
> local->io_thread is cleared with WRITE_ONCE() when the I/O thread exits, so
> the second load can see NULL even if the first load did not.
>
> Take a READ_ONCE() snapshot and use it for both the NULL check and the
> wake_up_process() call, as rxrpc_encap_rcv() already does.
>
> Fixes: 5800b1cf3fd8 ("rxrpc: Allow CHALLENGEs to the passed to the app for a RESPONSE")
> Signed-off-by: Xuanqiang Luo <luoxuanqiang@xxxxxxxxxx>
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>