From: Soheil Hassas Yeganeh Date: Mon, 15 May 2017 21:05:47 +0000 (-0400) Subject: tcp: eliminate negative reordering in tcp_clean_rtx_queue X-Git-Tag: v3.2.93~97 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a0fe5df7de562f40d800c6797a8370cf139ec2c;p=pandora-kernel.git tcp: eliminate negative reordering in tcp_clean_rtx_queue commit bafbb9c73241760023d8981191ddd30bb1c6dbac upstream. tcp_ack() can call tcp_fragment() which may dededuct the value tp->fackets_out when MSS changes. When prior_fackets is larger than tp->fackets_out, tcp_clean_rtx_queue() can invoke tcp_update_reordering() with negative values. This results in absurd tp->reodering values higher than sysctl_tcp_max_reordering. Note that tcp_update_reordering indeeds sets tp->reordering to min(sysctl_tcp_max_reordering, metric), but because the comparison is signed, a negative metric always wins. Fixes: c7caf8d3ed7a ("[TCP]: Fix reord detection due to snd_una covered holes") Reported-by: Rebecca Isaacs Signed-off-by: Soheil Hassas Yeganeh Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed