tcp: warn on negative reordering values
Subsystems (3)
PATCH 1/1 tcp: warn on negative reordering values
From: Soheil Hassas Yeganeh <[email protected]>
Commit bafbb9c73241 ("tcp: eliminate negative reordering in tcp_clean_rtx_queue") fixes an issue for negative reordering metrics.
To be resilient to such errors, warn and return when a negative metric is passed to tcp_update_reordering().
Signed-off-by Soheil Hassas Yeganeh <[email protected]>
Signed-off-by Neal Cardwell <[email protected]>
Signed-off-by Yuchung Cheng <[email protected]>
Signed-off-by Eric Dumazet <[email protected]>
--- net/ipv4/tcp_input.c | 3 +++ 1 file changed, 3 insertions(+)
net/ipv4/tcp_input.c +3 -0
@@ -886,6 +886,9 @@ static void tcp_update_reordering(struct sock *sk, const int metric,struct tcp_sock *tp =tcp_sk (sk);int mib_idx; +if (WARN_ON_ONCE (metric <0 )) +return ; +if (metric > tp->reordering) { tp->reordering =min (sysctl_tcp_max_reordering, metric);
Signature · 1 line
2.13.0.303.g4ebf302169-goog
From: Soheil Hassas Yeganeh <[email protected]>
Date: Tue, 16 May 2017 17:39:02 -0400
Quoted 6 lines
From: Soheil Hassas Yeganeh <[email protected]>
Commit
bafbb9c73241("tcp: eliminate negative reordering intcp_clean_rtx_queue") fixes an issue for negative reordering metrics.
Quoted 7 lines
To be resilient to such errors, warn and return when a negative metric is passed to
tcp_update_reordering().Signed-off-by Soheil Hassas Yeganeh <[email protected]>Signed-off-by Neal Cardwell <[email protected]>Signed-off-by Yuchung Cheng <[email protected]>Signed-off-by Eric Dumazet <[email protected]>
Applied, thanks.