From c57db4070840ed7acc6924e4039035cc3497b835 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 7 May 2020 18:50:34 +0200 Subject: [PATCH] 4.19-stable patches added patches: sctp-fix-shutdown-ctsn-ack-in-the-peer-restart-case.patch --- ...wn-ctsn-ack-in-the-peer-restart-case.patch | 45 +++++++++++++++++++ queue-4.19/series | 1 + 2 files changed, 46 insertions(+) create mode 100644 queue-4.19/sctp-fix-shutdown-ctsn-ack-in-the-peer-restart-case.patch diff --git a/queue-4.19/sctp-fix-shutdown-ctsn-ack-in-the-peer-restart-case.patch b/queue-4.19/sctp-fix-shutdown-ctsn-ack-in-the-peer-restart-case.patch new file mode 100644 index 00000000000..7814317fc72 --- /dev/null +++ b/queue-4.19/sctp-fix-shutdown-ctsn-ack-in-the-peer-restart-case.patch @@ -0,0 +1,45 @@ +From 12dfd78e3a74825e6f0bc8df7ef9f938fbc6bfe3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= +Date: Tue, 21 Apr 2020 22:03:42 +0300 +Subject: sctp: Fix SHUTDOWN CTSN Ack in the peer restart case +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Jere Leppänen + +commit 12dfd78e3a74825e6f0bc8df7ef9f938fbc6bfe3 upstream. + +When starting shutdown in sctp_sf_do_dupcook_a(), get the value for +SHUTDOWN Cumulative TSN Ack from the new association, which is +reconstructed from the cookie, instead of the old association, which +the peer doesn't have anymore. + +Otherwise the SHUTDOWN is either ignored or replied to with an ABORT +by the peer because CTSN Ack doesn't match the peer's Initial TSN. + +Fixes: bdf6fa52f01b ("sctp: handle association restarts when the socket is closed.") +Signed-off-by: Jere Leppänen +Acked-by: Marcelo Ricardo Leitner +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + net/sctp/sm_make_chunk.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/net/sctp/sm_make_chunk.c ++++ b/net/sctp/sm_make_chunk.c +@@ -871,7 +871,11 @@ struct sctp_chunk *sctp_make_shutdown(co + struct sctp_chunk *retval; + __u32 ctsn; + +- ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); ++ if (chunk && chunk->asoc) ++ ctsn = sctp_tsnmap_get_ctsn(&chunk->asoc->peer.tsn_map); ++ else ++ ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); ++ + shut.cum_tsn_ack = htonl(ctsn); + + retval = sctp_make_control(asoc, SCTP_CID_SHUTDOWN, 0, diff --git a/queue-4.19/series b/queue-4.19/series index 8d5583f6e01..ea249aa07dc 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -19,3 +19,4 @@ scripts-config-allow-colons-in-option-strings-for-se.patch lib-mpi-fix-building-for-powerpc-with-clang.patch net-bcmgenet-suppress-warnings-on-failed-rx-skb-allo.patch net-systemport-suppress-warnings-on-failed-rx-skb-al.patch +sctp-fix-shutdown-ctsn-ack-in-the-peer-restart-case.patch -- 2.47.3