sctp: Fix SHUTDOWN CTSN Ack in the peer restart case
authorJere Leppänen <jere.leppanen@nokia.com>
Tue, 21 Apr 2020 19:03:42 +0000 (22:03 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2020 08:31:29 +0000 (10:31 +0200)
commit3fb4c93dc761906e95a3e0ce05c33f9f23a94aa1
tree19e8b44c25b03e07f82b274c6d7f270086fbb769
parent9da07c4aeaf78cca7d786c003595df38ad838aa8
sctp: Fix SHUTDOWN CTSN Ack in the peer restart case

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 <jere.leppanen@nokia.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sctp/sm_make_chunk.c