1 From 45e77d314585869dfe43c82679f7e08c9b35b898 Mon Sep 17 00:00:00 2001
2 From: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
3 Date: Mon, 19 Jul 2010 01:16:18 +0000
4 Subject: tcp: fix crash in tcp_xmit_retransmit_queue
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 From: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
11 commit 45e77d314585869dfe43c82679f7e08c9b35b898 upstream.
13 It can happen that there are no packets in queue while calling
14 tcp_xmit_retransmit_queue(). tcp_write_queue_head() then returns
15 NULL and that gets deref'ed to get sacked into a local var.
17 There is no work to do if no packets are outstanding so we just
20 This oops was introduced by 08ebd1721ab8fd (tcp: remove tp->lost_out
21 guard to make joining diff nicer).
23 Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
24 Reported-by: Lennart Schulte <lennart.schulte@nets.rwth-aachen.de>
25 Tested-by: Lennart Schulte <lennart.schulte@nets.rwth-aachen.de>
26 Signed-off-by: David S. Miller <davem@davemloft.net>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
30 net/ipv4/tcp_output.c | 3 +++
31 1 file changed, 3 insertions(+)
33 --- a/net/ipv4/tcp_output.c
34 +++ b/net/ipv4/tcp_output.c
35 @@ -2037,6 +2037,9 @@ void tcp_xmit_retransmit_queue(struct so
37 int fwd_rexmitting = 0;
39 + if (!tp->packets_out)
43 tp->retransmit_high = tp->snd_una;