Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp803032ybk; Wed, 13 May 2020 13:33:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv60h2pjwZV6Okj5WLpj4hFKQt1smwzkMWP0Hjw7EXQWXeX14lJejkA6liGmGpLMU78IGa X-Received: by 2002:a17:906:6d90:: with SMTP id h16mr743400ejt.117.1589402033476; Wed, 13 May 2020 13:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589402033; cv=none; d=google.com; s=arc-20160816; b=gGlu8krbT58FTDiY9jgB5pA8d6gaixA1SC5ym6vzfzzzqjHvrL7CLP7YQvKNBVuomi JOuQJNtC/72BpKfv7/EBOOhnj3mxZLFXdvWDVnf4w8/xklSc+OzuVMxLRzO7uskblqbz gJeC7CHGhXcEPZC9PtbxzfS1dTXO4rL7CqKmr0ySSrhz4VlnHR8P4MlCWL9xkcVzhD8Z ZqoRRWabEwomKPvuA6TK80AfJsODwjRYRvnlZTd2Fq8N0OgdWcfjMUt/TobfoyXnrlir cP0Kv47/ZtfrXM44rjwpSupIGplSXV2vUw1ZKIHkzR3JMjBwxIj3oW77fJ/6jPhJk313 y2uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p5FCUB52103fVcEck3Eh1VKS66S6Cnf/Yd3zDdRGKtY=; b=pHRQNHy+du+cocQnbHvuDQmYhe72tuwERqBWHAYQD+Yja6hmlF1MDucXIVRGT7Qt5H M/98TI6Gh18AO9Yp0fb3vSiNzW+O80oXPamYpghr75SXQDR9Ew3E7yecffl4AW6TnCGz vNreh07c2L35i5DFrEwKs8zr7Y24spNaUF4c386N2+0BvjmZGvcZsSqmLC7VN/JBWzF7 AxZs6wc/u/H+TmdSXpJzkrgd08f9MVSoVq1WqSH+AW56JFLapq2urAinzSPbF0m+tB47 k06/RNhE1yLLpVezUgYiuB7xbSYCOeTlPdUTwB+D/w5FoTiuM1aqNclqd0mkWpamEEcM uMLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tvG0Hgaz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dc9si470898ejb.370.2020.05.13.13.33.31; Wed, 13 May 2020 13:33:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tvG0Hgaz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388684AbgEMKEd (ORCPT + 99 others); Wed, 13 May 2020 06:04:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:45708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732894AbgEMJrj (ORCPT ); Wed, 13 May 2020 05:47:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 A5B232078C; Wed, 13 May 2020 09:47:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363259; bh=twbmB15laeg2s2WH+3sd8ZjdGuGH39wXrzDitwnqjzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tvG0HgazuGrS19EpKZ2v8LDby7cQaPqeuKvHjtxZkWsDIcC9P3TtAcUB1o/Ms7gKH c5+CA/6CJPDtw/qEv/ppFSU3i44aOBBbM5QscRvIYd3oVX8WR30gwXU4qfn0Z4h9rH +Fy7HJobc3LjECGNgdkabQ+qZYT1giTd4lhv50R4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Jere=20Lepp=C3=A4nen?= , Marcelo Ricardo Leitner , "David S. Miller" , Guenter Roeck Subject: [PATCH 4.19 20/48] sctp: Fix bundling of SHUTDOWN with COOKIE-ACK Date: Wed, 13 May 2020 11:44:46 +0200 Message-Id: <20200513094356.037688991@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513094351.100352960@linuxfoundation.org> References: <20200513094351.100352960@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jere Leppänen commit 145cb2f7177d94bc54563ed26027e952ee0ae03c upstream. When we start shutdown in sctp_sf_do_dupcook_a(), we want to bundle the SHUTDOWN with the COOKIE-ACK to ensure that the peer receives them at the same time and in the correct order. This bundling was broken by commit 4ff40b86262b ("sctp: set chunk transport correctly when it's a new asoc"), which assigns a transport for the COOKIE-ACK, but not for the SHUTDOWN. Fix this by passing a reference to the COOKIE-ACK chunk as an argument to sctp_sf_do_9_2_start_shutdown() and onward to sctp_make_shutdown(). This way the SHUTDOWN chunk is assigned the same transport as the COOKIE-ACK chunk, which allows them to be bundled. In sctp_sf_do_9_2_start_shutdown(), the void *arg parameter was previously unused. Now that we're taking it into use, it must be a valid pointer to a chunk, or NULL. There is only one call site where it's not, in sctp_sf_autoclose_timer_expire(). Fix that too. Fixes: 4ff40b86262b ("sctp: set chunk transport correctly when it's a new asoc") Signed-off-by: Jere Leppänen Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller Cc: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- net/sctp/sm_statefuns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -1880,7 +1880,7 @@ static enum sctp_disposition sctp_sf_do_ */ sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl)); return sctp_sf_do_9_2_start_shutdown(net, ep, asoc, - SCTP_ST_CHUNK(0), NULL, + SCTP_ST_CHUNK(0), repl, commands); } else { sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, @@ -5483,7 +5483,7 @@ enum sctp_disposition sctp_sf_do_9_2_sta * in the Cumulative TSN Ack field the last sequential TSN it * has received from the peer. */ - reply = sctp_make_shutdown(asoc, NULL); + reply = sctp_make_shutdown(asoc, arg); if (!reply) goto nomem; @@ -6081,7 +6081,7 @@ enum sctp_disposition sctp_sf_autoclose_ disposition = SCTP_DISPOSITION_CONSUME; if (sctp_outq_is_empty(&asoc->outqueue)) { disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type, - arg, commands); + NULL, commands); } return disposition;