Message ID | 20230515161723.275161336@linuxfoundation.org (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | None | expand |
Hello: This series was applied to bpf/bpf-next.git (master) by Arnaldo Carvalho de Melo <acme@redhat.com>: On Mon, 15 May 2023 18:23:54 +0200 you wrote: > From: David Howells <dhowells@redhat.com> > > [ Upstream commit 2b5fdc0f5caa505afe34d608e2eefadadf2ee67a ] > > Inside the loop in rxrpc_wait_to_be_connected() it checks call->error to > see if it should exit the loop without first checking the call state. This > is probably safe as if call->error is set, the call is dead anyway, but we > should probably wait for the call state to have been set to completion > first, lest it cause surprise on the way out. > > [...] Here is the summary with links: - [6.3,022/246] rxrpc: Fix potential data race in rxrpc_wait_to_be_connected() (no matching commit) - [6.3,051/246] rxrpc: Fix hard call timeout units (no matching commit) - [6.3,052/246] rxrpc: Make it so that a waiting process can be aborted (no matching commit) - [6.3,053/246] rxrpc: Fix timeout of a call that hasnt yet been granted a channel (no matching commit) - [6.3,100/246] perf lock contention: Fix compiler builtin detection https://git.kernel.org/bpf/bpf-next/c/17535a33a9c1 You are awesome, thank you!
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c index da49fcf1c4567..6caa47d352ed6 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c @@ -50,15 +50,11 @@ static int rxrpc_wait_to_be_connected(struct rxrpc_call *call, long *timeo) _enter("%d", call->debug_id); if (rxrpc_call_state(call) != RXRPC_CALL_CLIENT_AWAIT_CONN) - return call->error; + goto no_wait; add_wait_queue_exclusive(&call->waitq, &myself); for (;;) { - ret = call->error; - if (ret < 0) - break; - switch (call->interruptibility) { case RXRPC_INTERRUPTIBLE: case RXRPC_PREINTERRUPTIBLE: @@ -69,10 +65,9 @@ static int rxrpc_wait_to_be_connected(struct rxrpc_call *call, long *timeo) set_current_state(TASK_UNINTERRUPTIBLE); break; } - if (rxrpc_call_state(call) != RXRPC_CALL_CLIENT_AWAIT_CONN) { - ret = call->error; + + if (rxrpc_call_state(call) != RXRPC_CALL_CLIENT_AWAIT_CONN) break; - } if ((call->interruptibility == RXRPC_INTERRUPTIBLE || call->interruptibility == RXRPC_PREINTERRUPTIBLE) && signal_pending(current)) { @@ -85,6 +80,7 @@ static int rxrpc_wait_to_be_connected(struct rxrpc_call *call, long *timeo) remove_wait_queue(&call->waitq, &myself); __set_current_state(TASK_RUNNING); +no_wait: if (ret == 0 && rxrpc_call_is_complete(call)) ret = call->error;