提交 6f5b24ee 编写于 作者: S Soheil Hassas Yeganeh 提交者: David S. Miller

tcp: warn on negative reordering values

Commit bafbb9c7 ("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: NSoheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: NNeal Cardwell <ncardwell@google.com>
Signed-off-by: NYuchung Cheng <ycheng@google.com>
Signed-off-by: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c6cd850d
...@@ -887,6 +887,9 @@ static void tcp_update_reordering(struct sock *sk, const int metric, ...@@ -887,6 +887,9 @@ static void tcp_update_reordering(struct sock *sk, const int metric,
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
int mib_idx; int mib_idx;
if (WARN_ON_ONCE(metric < 0))
return;
if (metric > tp->reordering) { if (metric > tp->reordering) {
tp->reordering = min(sysctl_tcp_max_reordering, metric); tp->reordering = min(sysctl_tcp_max_reordering, metric);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册