From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932994Ab0IXQsH (ORCPT ); Fri, 24 Sep 2010 12:48:07 -0400 Received: from kroah.org ([198.145.64.141]:37064 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932927Ab0IXQe6 (ORCPT ); Fri, 24 Sep 2010 12:34:58 -0400 X-Mailbox-Line: From gregkh@clark.site Fri Sep 24 09:33:45 2010 Message-Id: <20100924163344.968320360@clark.site> User-Agent: quilt/0.48-11.2 Date: Fri, 24 Sep 2010 09:31:35 -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, "Steven J. Magnani" , "David S. Miller" Subject: [11/68] net: Fix oops from tcp_collapse() when using splice() In-Reply-To: <20100924163357.GA15741@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2.6.32-stable review patch. If anyone has any objections, please let us know. ------------------ From: Steven J. Magnani [ Upstream commit baff42ab1494528907bf4d5870359e31711746ae ] tcp_read_sock() can have a eat skbs without immediately advancing copied_seq. This can cause a panic in tcp_collapse() if it is called as a result of the recv_actor dropping the socket lock. A userspace program that splices data from a socket to either another socket or to a file can trigger this bug. Signed-off-by: Steven J. Magnani Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/tcp.c | 1 + 1 file changed, 1 insertion(+) --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1335,6 +1335,7 @@ int tcp_read_sock(struct sock *sk, read_ sk_eat_skb(sk, skb, 0); if (!desc->count) break; + tp->copied_seq = seq; } tp->copied_seq = seq;