Thread (20 messages) 20 messages, 8 authors, 2017-11-10

Re: [PATCH net] tcp: fix tcp_mtu_probe() vs highest_sack

From: Neal Cardwell <ncardwell@google.com>
Date: 2017-10-31 13:51:58

On Tue, Oct 31, 2017 at 2:08 AM, Eric Dumazet [off-list ref] wrote:
From: Eric Dumazet <redacted>

Based on SNMP values provided by Roman, Yuchung made the observation
that some crashes in tcp_sacktag_walk() might be caused by MTU probing.

Looking at tcp_mtu_probe(), I found that when a new skb was placed
in front of the write queue, we were not updating tcp highest sack.

If one skb is freed because all its content was copied to the new skb
(for MTU probing), then tp->highest_sack could point to a now freed skb.

Bad things would then happen, including infinite loops.

This patch renames tcp_highest_sack_combine() and uses it
from tcp_mtu_probe() to fix the bug.

Note that I also removed one test against tp->sacked_out,
since we want to replace tp->highest_sack regardless of whatever
condition, since keeping a stale pointer to freed skb is a recipe
for disaster.

Fixes: a47e5a988a57 ("[TCP]: Convert highest_sack to sk_buff to allow direct access")
Signed-off-by: Eric Dumazet <redacted>
Reported-by: Alexei Starovoitov <redacted>
Reported-by: Roman Gushchin <redacted>
Reported-by: Oleksandr Natalenko <redacted>
---
 include/net/tcp.h     |    6 +++---
 net/ipv4/tcp_output.c |    3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)
Acked-by: Neal Cardwell <ncardwell@google.com>

Nice catch, indeed. Thanks, Eric!

neal
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help