mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-14 09:09:56 +00:00
tcp: warn on negative reordering values
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 <soheil@google.com> Signed-off-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c6cd850d65
commit
6f5b24eed0
@ -887,6 +887,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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user