From patchwork Wed Jul 6 14:41:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Pisati X-Patchwork-Id: 103491 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 9ACB2B6F00 for ; Thu, 7 Jul 2011 00:41:48 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QeTIF-0001TG-OY; Wed, 06 Jul 2011 14:41:36 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QeTIA-0001PI-Cw for kernel-team@lists.ubuntu.com; Wed, 06 Jul 2011 14:41:30 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QeTI8-0001rR-3x for ; Wed, 06 Jul 2011 14:41:28 +0000 Received: from dynamic-adsl-94-36-117-47.clienti.tiscali.it ([94.36.117.47] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1QeTI7-0004e0-US for kernel-team@lists.ubuntu.com; Wed, 06 Jul 2011 14:41:28 +0000 From: Paolo Pisati To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2] tcp: Increase TCP_MAXSEG socket option minimum CVE-2010-4165 Date: Wed, 6 Jul 2011 16:41:13 +0200 Message-Id: <1309963273-7247-3-git-send-email-paolo.pisati@canonical.com> X-Mailer: git-send-email 1.7.5.3 In-Reply-To: <1309963273-7247-1-git-send-email-paolo.pisati@canonical.com> References: <1309963273-7247-1-git-send-email-paolo.pisati@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: "David S. Miller" BugLink: http://bugs.launchpad.net/bugs/806374 commit upstream 7a1abd08d52fdeddb3e9a5a33f2f15cc6a5674d2 As noted by Steve Chen, since commit f5fff5dc8a7a3f395b0525c02ba92c95d42b7390 ("tcp: advertise MSS requested by user") we can end up with a situation where tcp_select_initial_window() does a divide by a zero (or even negative) mss value. The problem is that sometimes we effectively subtract TCPOLEN_TSTAMP_ALIGNED and/or TCPOLEN_MD5SIG_ALIGNED from the mss. Fix this by increasing the minimum from 8 to 64. CVE-2010-4165 Reported-by: Steve Chen Signed-off-by: David S. Miller Signed-off-by: Paolo Pisati --- net/ipv4/tcp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 4305154..4174f20 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1826,7 +1826,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level, /* Values greater than interface MTU won't take effect. However * at the point when this call is done we typically don't yet * know which interface is going to be used */ - if (val < 8 || val > MAX_TCP_WINDOW) { + if (val < 64 || val > MAX_TCP_WINDOW) { err = -EINVAL; break; }