Commit 2100844c authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller
Browse files

tcp: Fix out of bounds access to tcpm_vals

The recent patch "tcp: Maintain dynamic metrics in local cache." introduced
an out of bounds access due to what appears to be a typo.   I believe this
change should resolve the issue by replacing the access to RTAX_CWND with
Signed-off-by: default avatarAlexander Duyck <>
Signed-off-by: default avatarDavid S. Miller <>
parent 48ee3569
......@@ -412,7 +412,7 @@ void tcp_update_metrics(struct sock *sk)
max(tp->snd_cwnd >> 1, tp->snd_ssthresh));
if (!tcp_metric_locked(tm, TCP_METRIC_CWND)) {
val = tcp_metric_get(tm, TCP_METRIC_CWND);
tcp_metric_set(tm, RTAX_CWND, (val + tp->snd_cwnd) >> 1);
tcp_metric_set(tm, TCP_METRIC_CWND, (val + tp->snd_cwnd) >> 1);
} else {
/* Else slow start did not finish, cwnd is non-sense,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment