rxrpc: Fix variable overwrite
Subsystems (3)
PATCH v3 1/1 rxrpc: Fix variable overwrite
Values assigned to both variable resend_at and ack_at are overwritten before they can be used.
The correct fix here is to add 'now' to the previously computed value in resend_at and ack_at.
Addresses-Coverity-ID: 1462262
Addresses-Coverity-ID: 1462263
Addresses-Coverity-ID: 1462264
Fixes beb8e5e4f38c ("rxrpc: Express protocol timeouts in terms of RTT")
Signed-off-by Gustavo A. R. Silva <[email protected]>
---
Changes in v2:
- Add 'now' to the previously-computed value stored in resend_at instead of removing the code.
Changes in v3:
- Add 'now' to the previously-computed value stored in ack_at instead of removing the code.
- Combine two previously sent patches into this one.
net/rxrpc/call_event.c | 2 +- net/rxrpc/sendmsg.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/rxrpc/call_event.c +1 -1
@@ -123,7 +123,7 @@ static void __rxrpc_propose_ACK(struct rxrpc_call *call, u8 ack_reason,else ack_at = expiry; - ack_at = jiffies + expiry; + ack_at += now;if (time_before (ack_at, call->ack_at)) {WRITE_ONCE (call->ack_at, ack_at); rxrpc_reduce_call_timer(call, ack_at, now,
net/rxrpc/sendmsg.c +1 -1
@@ -233,7 +233,7 @@ static void rxrpc_queue_packet(struct rxrpc_sock *rx, struct rxrpc_call *call,if (resend_at <1 ) resend_at =1 ; - resend_at = now + rxrpc_resend_timeout; + resend_at += now;WRITE_ONCE (call->resend_at, resend_at);rxrpc_reduce_call_timer (call, resend_at, now, rxrpc_timer_set_for_send);
Signature · 1 line
2.7.4