Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2056760imm; Thu, 24 May 2018 05:11:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqALePcitakm7bJ3kahhf709hLoOx4R6Cv7XrMeZIlpuDsJmcxa9iT7RzMIZ65/EIY79vHw X-Received: by 2002:a65:62d9:: with SMTP id m25-v6mr5665693pgv.407.1527163888898; Thu, 24 May 2018 05:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527163888; cv=none; d=google.com; s=arc-20160816; b=Q0pfc/llJGDi3Bb1gd1sjtneSMZ8BSzEsOHVSpDBM8HJXeuLQbOCDJSBFQM9J1sqET egpnRt9Lp1QZ20wqUJXzdugeBmQxmnMFa8JySFgBu4DOEwuv1O+DGhNU1NIR9fHnqN52 z9HobAQH8+IVe/nAu5CTc99P5V0Ooayx0txlNEUPLg584xMd/Cb4laNM6StX8wu2YGoG vPjhbI61yadhQckRcMganMXxm599IrjBaetOk0pQI5lIaNrwccUoKohc77tCYeOV5f4P j0CrRxdy5uNgOyLBIPdiTxIwM5PqX7Fai83MhVYY+/l0r+swkJghCTKmMDGh3sDuhB2p Pdww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=EhzoPgfxy91tFrE9WVh3id0QY+PFmJ6FJZpdyco/STM=; b=Hel20/DCnSXUJ7CkkKCDLmrUSRiL85uUtRHOIg3eHQZOYh7qXJIuIzbTX2QEtke+8p u1G61FEUcgvuG+IVTSXHV56sdFnmKKKghV+BEY6nCIb992MtWei0x/pv8ixlNjm1oBTe P5y815YTsj2BUDO9kVzodCNtlayN6fhqZve+CicsEhLpUwxtDkKaxQkVtZpX4FsEjAO3 VZASE8nN4l+0qB6fzvh4Bnlym2FrO94kWEyphrmAJasW1wOZdmKsLyvlr7agx/RX612u AXcA56XjoVY69y9nKLEu6HYH+x0GSH7ZEaeeGiCXZ22/sSo14UqlMNNh+xWgG0cOBLG3 rmnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=usVOvFT7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e26-v6si21092638pfb.185.2018.05.24.05.10.55; Thu, 24 May 2018 05:11:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=usVOvFT7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969721AbeEXMKJ (ORCPT + 99 others); Thu, 24 May 2018 08:10:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:54758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966457AbeEXJnS (ORCPT ); Thu, 24 May 2018 05:43:18 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 057012089C; Thu, 24 May 2018 09:43:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527154997; bh=dL7ZxCbI10PwfOAwInU1wBI7EqKAUS7b4GN4iVm7uXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=usVOvFT74PXCyjLDnTMFiEqV2PMxgqbel5BN2+Y6l4bfNVVR83y+5Lm0seFMUdbjs AvSvbKbnLle5xnM5jNYhMsHQSSKSllW96oqP8eMzKVjNSkZPYfTEJB8H/eaTNpXeF6 sjaGgp/5pEad+CqCeED3G/rLFWYZIfRPnWH3tnc0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xin Long , Neil Horman , Marcelo Ricardo Leitner , "David S. Miller" Subject: [PATCH 4.4 18/92] sctp: fix the issue that the cookie-ack with auth cant get processed Date: Thu, 24 May 2018 11:37:55 +0200 Message-Id: <20180524093200.827087772@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093159.286472249@linuxfoundation.org> References: <20180524093159.286472249@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xin Long [ Upstream commit ce402f044e4e432c296f90eaabb8dbe8f3624391 ] When auth is enabled for cookie-ack chunk, in sctp_inq_pop, sctp processes auth chunk first, then continues to the next chunk in this packet if chunk_end + chunk_hdr size < skb_tail_pointer(). Otherwise, it will go to the next packet or discard this chunk. However, it missed the fact that cookie-ack chunk's size is equal to chunk_hdr size, which couldn't match that check, and thus this chunk would not get processed. This patch fixes it by changing the check to chunk_end + chunk_hdr size <= skb_tail_pointer(). Fixes: 26b87c788100 ("net: sctp: fix remote memory pressure from excessive queueing") Signed-off-by: Xin Long Acked-by: Neil Horman Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sctp/inqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/sctp/inqueue.c +++ b/net/sctp/inqueue.c @@ -178,7 +178,7 @@ struct sctp_chunk *sctp_inq_pop(struct s skb_pull(chunk->skb, sizeof(sctp_chunkhdr_t)); chunk->subh.v = NULL; /* Subheader is no longer valid. */ - if (chunk->chunk_end + sizeof(sctp_chunkhdr_t) < + if (chunk->chunk_end + sizeof(sctp_chunkhdr_t) <= skb_tail_pointer(chunk->skb)) { /* This is not a singleton */ chunk->singleton = 0;