From patchwork Mon Jul 11 14:20:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Pisati X-Patchwork-Id: 104224 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 2BC07B6F6F for ; Tue, 12 Jul 2011 00:20:53 +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 1QgHLl-0007ZI-Jp; Mon, 11 Jul 2011 14:20:41 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QgHLe-0007RE-WD for kernel-team@lists.ubuntu.com; Mon, 11 Jul 2011 14:20:35 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QgHLe-000394-TP for ; Mon, 11 Jul 2011 14:20:34 +0000 Received: from dynamic-adsl-94-36-117-159.clienti.tiscali.it ([94.36.117.159] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1QgHLe-0004fy-O6 for kernel-team@lists.ubuntu.com; Mon, 11 Jul 2011 14:20:34 +0000 From: Paolo Pisati To: kernel-team@lists.ubuntu.com Subject: [PATCH 09/11] tipc: use limited socket backlog CVE-2010-4251 Date: Mon, 11 Jul 2011 16:20:18 +0200 Message-Id: <1310394020-4846-10-git-send-email-paolo.pisati@canonical.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1310394020-4846-1-git-send-email-paolo.pisati@canonical.com> References: <1310394020-4846-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: Zhu Yi BugLink: http://bugs.launchpad.net/bugs/807462 Make tipc adapt to the limited socket backlog change. Cc: Jon Maloy Cc: Allan Stephens Signed-off-by: Zhu Yi Acked-by: Eric Dumazet Acked-by: Allan Stephens Signed-off-by: David S. Miller (cherry picked from commit 53eecb1be5ae499d399d2923933937a9ea1a284f) Signed-off-by: Paolo Pisati --- net/tipc/socket.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 8ebf4975..bf4b320 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -1323,8 +1323,10 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf) if (!sock_owned_by_user(sk)) { res = filter_rcv(sk, buf); } else { - sk_add_backlog(sk, buf); - res = TIPC_OK; + if (sk_add_backlog_limited(sk, buf)) + res = TIPC_ERR_OVERLOAD; + else + res = TIPC_OK; } bh_unlock_sock(sk);