Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756349Ab0G3TIO (ORCPT ); Fri, 30 Jul 2010 15:08:14 -0400 Received: from kroah.org ([198.145.64.141]:51568 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757548Ab0G3RSf (ORCPT ); Fri, 30 Jul 2010 13:18:35 -0400 X-Mailbox-Line: From gregkh@clark.site Fri Jul 30 10:15:04 2010 Message-Id: <20100730171504.703859446@clark.site> User-Agent: quilt/0.48-11.2 Date: Fri, 30 Jul 2010 10:14:43 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, =?ISO-8859-15?q?Ilpo=20J=C3=A4rvinen?= , "David S. Miller" Subject: [055/165] tcp: fix crash in tcp_xmit_retransmit_queue In-Reply-To: <20100730171550.GA1299@kroah.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1454 Lines: 47 2.6.32-stable review patch. If anyone has any objections, please let us know. ------------------ From: Ilpo Järvinen commit 45e77d314585869dfe43c82679f7e08c9b35b898 upstream. It can happen that there are no packets in queue while calling tcp_xmit_retransmit_queue(). tcp_write_queue_head() then returns NULL and that gets deref'ed to get sacked into a local var. There is no work to do if no packets are outstanding so we just exit early. This oops was introduced by 08ebd1721ab8fd (tcp: remove tp->lost_out guard to make joining diff nicer). Signed-off-by: Ilpo Järvinen Reported-by: Lennart Schulte Tested-by: Lennart Schulte Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/tcp_output.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2037,6 +2037,9 @@ void tcp_xmit_retransmit_queue(struct so int mib_idx; int fwd_rexmitting = 0; + if (!tp->packets_out) + return; + if (!tp->lost_out) tp->retransmit_high = tp->snd_una; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/