All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] sctp: Fix problems with peer restart when in SHUTDOWN-PENDING state and socket is closed
@ 2020-04-21 19:03 ` Jere Leppänen
  0 siblings, 0 replies; 12+ messages in thread
From: Jere Leppänen @ 2020-04-21 19:03 UTC (permalink / raw)
  To: linux-sctp, netdev, Vlad Yasevich, Neil Horman,
	Marcelo Ricardo Leitner, David S . Miller
  Cc: Xin Long

These patches are related to the scenario described in commit
bdf6fa52f01b ("sctp: handle association restarts when the socket is
closed."). To recap, when our association is in SHUTDOWN-PENDING state
and we've closed our one-to-one socket, while the peer crashes without
being detected, restarts and reconnects using the same addresses and
ports, we start association shutdown.

In this case, Cumulative TSN Ack in the SHUTDOWN that we send has
always been incorrect. Additionally, bundling of the SHUTDOWN with the
COOKIE-ACK was broken by a later commit. This series fixes both of
these issues.

Jere Leppänen (2):
  sctp: Fix bundling of SHUTDOWN with COOKIE-ACK
  sctp: Fix SHUTDOWN CTSN Ack in the peer restart case

 net/sctp/sm_make_chunk.c | 6 +++++-
 net/sctp/sm_statefuns.c  | 6 +++---
 2 files changed, 8 insertions(+), 4 deletions(-)


base-commit: a460fc5d4c170806a31e590df37ead3ab951315c
-- 
2.25.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH net 0/2] sctp: Fix problems with peer restart when in SHUTDOWN-PENDING state and socket is cl
@ 2020-04-21 19:03 ` Jere Leppänen
  0 siblings, 0 replies; 12+ messages in thread
From: Jere Leppänen @ 2020-04-21 19:03 UTC (permalink / raw)
  To: linux-sctp, netdev, Vlad Yasevich, Neil Horman,
	Marcelo Ricardo Leitner, David S . Miller
  Cc: Xin Long

VGhlc2UgcGF0Y2hlcyBhcmUgcmVsYXRlZCB0byB0aGUgc2NlbmFyaW8gZGVzY3JpYmVkIGluIGNv
bW1pdApiZGY2ZmE1MmYwMWIgKCJzY3RwOiBoYW5kbGUgYXNzb2NpYXRpb24gcmVzdGFydHMgd2hl
biB0aGUgc29ja2V0IG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yLjI1
LjIKCg=

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH net 1/2] sctp: Fix bundling of SHUTDOWN with COOKIE-ACK
  2020-04-21 19:03 ` [PATCH net 0/2] sctp: Fix problems with peer restart when in SHUTDOWN-PENDING state and socket is cl Jere Leppänen
@ 2020-04-21 19:03   ` Jere Leppänen
  -1 siblings, 0 replies; 12+ messages in thread
From: Jere Leppänen @ 2020-04-21 19:03 UTC (permalink / raw)
  To: linux-sctp, netdev, Vlad Yasevich, Neil Horman,
	Marcelo Ricardo Leitner, David S . Miller
  Cc: Xin Long

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 <jere.leppanen@nokia.com>
---
 net/sctp/sm_statefuns.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 6a16af4b1ef6..26788f4a3b9e 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1865,7 +1865,7 @@ static enum sctp_disposition sctp_sf_do_dupcook_a(
 		 */
 		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,
@@ -5470,7 +5470,7 @@ enum sctp_disposition sctp_sf_do_9_2_start_shutdown(
 	 * 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;
 
@@ -6068,7 +6068,7 @@ enum sctp_disposition sctp_sf_autoclose_timer_expire(
 	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;
-- 
2.25.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH net 1/2] sctp: Fix bundling of SHUTDOWN with COOKIE-ACK
@ 2020-04-21 19:03   ` Jere Leppänen
  0 siblings, 0 replies; 12+ messages in thread
From: Jere Leppänen @ 2020-04-21 19:03 UTC (permalink / raw)
  To: linux-sctp, netdev, Vlad Yasevich, Neil Horman,
	Marcelo Ricardo Leitner, David S . Miller
  Cc: Xin Long

V2hlbiB3ZSBzdGFydCBzaHV0ZG93biBpbiBzY3RwX3NmX2RvX2R1cGNvb2tfYSgpLCB3ZSB3YW50
IHRvIGJ1bmRsZQp0aGUgU0hVVERPV04gd2l0aCB0aGUgQ09PS0lFLUFDSyB0byBlbnN1cmUgdGhh
dCB0aGUgcGVlciByZWNlaXZlcyB0aGVtCmF0IHRoZSBzYW1lIHRpbWUgYW5kIGluIHRoZSBjb3Jy
ZWN0IG9yZGVyLiBUaGlzIGJ1bmRsaW5nIHdhcyBicm9rZW4gYnkKY29tbWl0IDRmZjQwYjg2MjYy
YiAoInNjdHA6IHNldCBjaHVuayB0cmFuc3BvcnQgY29yc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G93bihhc29jLCBOVUxMKTsKKwlyZXBseSA9IHNjdHBfbWFrZV9zaHV0ZG93bihh
c29jLCBhcmcpOwogCWlmICghcmVwbHkpCiAJCWdvdG8gbm9tZW07CiAKQEAgLTYwNjgsNyArNjA2
OCw3IEBAIGVudW0gc2N0cF9kaXNwb3NpdGlvbiBzY3RwX3NmX2F1dG9jbG9zZV90aW1lcl9leHBp
cmUoCiAJZGlzcG9zaXRpb24gPSBTQ1RQX0RJU1BPU0lUSU9OX0NPTlNVTUU7CiAJaWYgKHNjdHBf
b3V0cV9pc19lbXB0eSgmYXNvYy0+b3V0cXVldWUpKSB7CiAJCWRpc3Bvc2l0aW9uID0gc2N0cF9z
Zl9kb185XzJfc3RhcnRfc2h1dGRvd24obmV0LCBlcCwgYXNvYywgdHlwZSwKLQkJCQkJCQkgICAg
YXJnLCBjb21tYW5kcyk7CisJCQkJCQkJICAgIE5VTEwsIGNvbW1hbmRzKTsKIAl9CiAKIAlyZXR1
cm4gZGlzcG9zaXRpb247Ci0tIAoyLjI1LjIKCg=

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH net 2/2] sctp: Fix SHUTDOWN CTSN Ack in the peer restart case
  2020-04-21 19:03 ` [PATCH net 0/2] sctp: Fix problems with peer restart when in SHUTDOWN-PENDING state and socket is cl Jere Leppänen
@ 2020-04-21 19:03   ` Jere Leppänen
  -1 siblings, 0 replies; 12+ messages in thread
From: Jere Leppänen @ 2020-04-21 19:03 UTC (permalink / raw)
  To: linux-sctp, netdev, Vlad Yasevich, Neil Horman,
	Marcelo Ricardo Leitner, David S . Miller
  Cc: Xin Long

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>
---
 net/sctp/sm_make_chunk.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 09050c1d5517..f7cb0b7faec2 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -858,7 +858,11 @@ struct sctp_chunk *sctp_make_shutdown(const struct sctp_association *asoc,
 	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,
-- 
2.25.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH net 2/2] sctp: Fix SHUTDOWN CTSN Ack in the peer restart case
@ 2020-04-21 19:03   ` Jere Leppänen
  0 siblings, 0 replies; 12+ messages in thread
From: Jere Leppänen @ 2020-04-21 19:03 UTC (permalink / raw)
  To: linux-sctp, netdev, Vlad Yasevich, Neil Horman,
	Marcelo Ricardo Leitner, David S . Miller
  Cc: Xin Long

V2hlbiBzdGFydGluZyBzaHV0ZG93biBpbiBzY3RwX3NmX2RvX2R1cGNvb2tfYSgpLCBnZXQgdGhl
IHZhbHVlIGZvcgpTSFVURE9XTiBDdW11bGF0aXZlIFRTTiBBY2sgZnJvbSB0aGUgbmV3IGFzc29j
aWF0aW9uLCB3aGljaCBpcwpyZWNvbnN0cnVjdGVkIGZyb20gdGhlIGNvb2tpZSwgaW5zdGVhZCBv
ZiB0aGUgb2xkIGFzc29jaWF0aW9uLCB3aGljaAp0aGUgcGVlciBkb2Vzbid0IGhhdmUgYW55bW9y
ZS4KCk90aGVyd2lzZSB0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tPnBlZXIudHNuX21hcCk7CisJZWxzZQorCQljdHNuID0gc2N0cF90c25tYXBfZ2V0X2N0
c24oJmFzb2MtPnBlZXIudHNuX21hcCk7CisKIAlzaHV0LmN1bV90c25fYWNrID0gaHRvbmwoY3Rz
bik7CiAKIAlyZXR2YWwgPSBzY3RwX21ha2VfY29udHJvbChhc29jLCBTQ1RQX0NJRF9TSFVURE9X
TiwgMCwKLS0gCjIuMjUuMgoK

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net 1/2] sctp: Fix bundling of SHUTDOWN with COOKIE-ACK
  2020-04-21 19:03   ` Jere Leppänen
@ 2020-04-23  1:09     ` Marcelo Ricardo Leitner
  -1 siblings, 0 replies; 12+ messages in thread
From: Marcelo Ricardo Leitner @ 2020-04-23  1:09 UTC (permalink / raw)
  To: Jere Leppänen
  Cc: linux-sctp, netdev, Vlad Yasevich, Neil Horman, David S . Miller,
	Xin Long

On Tue, Apr 21, 2020 at 10:03:41PM +0300, Jere Leppänen wrote:
> 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 <jere.leppanen@nokia.com>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net 1/2] sctp: Fix bundling of SHUTDOWN with COOKIE-ACK
@ 2020-04-23  1:09     ` Marcelo Ricardo Leitner
  0 siblings, 0 replies; 12+ messages in thread
From: Marcelo Ricardo Leitner @ 2020-04-23  1:09 UTC (permalink / raw)
  To: Jere Leppänen
  Cc: linux-sctp, netdev, Vlad Yasevich, Neil Horman, David S . Miller,
	Xin Long

On Tue, Apr 21, 2020 at 10:03:41PM +0300, Jere Leppänen wrote:
> 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 <jere.leppanen@nokia.com>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net 2/2] sctp: Fix SHUTDOWN CTSN Ack in the peer restart case
  2020-04-21 19:03   ` Jere Leppänen
@ 2020-04-23  1:09     ` Marcelo Ricardo Leitner
  -1 siblings, 0 replies; 12+ messages in thread
From: Marcelo Ricardo Leitner @ 2020-04-23  1:09 UTC (permalink / raw)
  To: Jere Leppänen
  Cc: linux-sctp, netdev, Vlad Yasevich, Neil Horman, David S . Miller,
	Xin Long

On Tue, Apr 21, 2020 at 10:03:42PM +0300, Jere Leppänen wrote:
> 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>

Nice patches. Thanks.

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net 2/2] sctp: Fix SHUTDOWN CTSN Ack in the peer restart case
@ 2020-04-23  1:09     ` Marcelo Ricardo Leitner
  0 siblings, 0 replies; 12+ messages in thread
From: Marcelo Ricardo Leitner @ 2020-04-23  1:09 UTC (permalink / raw)
  To: Jere Leppänen
  Cc: linux-sctp, netdev, Vlad Yasevich, Neil Horman, David S . Miller,
	Xin Long

On Tue, Apr 21, 2020 at 10:03:42PM +0300, Jere Leppänen wrote:
> 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>

Nice patches. Thanks.

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net 0/2] sctp: Fix problems with peer restart when in SHUTDOWN-PENDING state and socket is closed
  2020-04-21 19:03 ` [PATCH net 0/2] sctp: Fix problems with peer restart when in SHUTDOWN-PENDING state and socket is cl Jere Leppänen
@ 2020-04-23  2:28   ` David Miller
  -1 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2020-04-23  2:28 UTC (permalink / raw)
  To: jere.leppanen
  Cc: linux-sctp, netdev, vyasevich, nhorman, marcelo.leitner, lucien.xin

From: Jere Leppänen <jere.leppanen@nokia.com>
Date: Tue, 21 Apr 2020 22:03:40 +0300

> These patches are related to the scenario described in commit
> bdf6fa52f01b ("sctp: handle association restarts when the socket is
> closed."). To recap, when our association is in SHUTDOWN-PENDING state
> and we've closed our one-to-one socket, while the peer crashes without
> being detected, restarts and reconnects using the same addresses and
> ports, we start association shutdown.
> 
> In this case, Cumulative TSN Ack in the SHUTDOWN that we send has
> always been incorrect. Additionally, bundling of the SHUTDOWN with the
> COOKIE-ACK was broken by a later commit. This series fixes both of
> these issues.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net 0/2] sctp: Fix problems with peer restart when in SHUTDOWN-PENDING state and socket i
@ 2020-04-23  2:28   ` David Miller
  0 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2020-04-23  2:28 UTC (permalink / raw)
  To: jere.leppanen
  Cc: linux-sctp, netdev, vyasevich, nhorman, marcelo.leitner, lucien.xin

From: Jere Leppänen <jere.leppanen@nokia.com>
Date: Tue, 21 Apr 2020 22:03:40 +0300

> These patches are related to the scenario described in commit
> bdf6fa52f01b ("sctp: handle association restarts when the socket is
> closed."). To recap, when our association is in SHUTDOWN-PENDING state
> and we've closed our one-to-one socket, while the peer crashes without
> being detected, restarts and reconnects using the same addresses and
> ports, we start association shutdown.
> 
> In this case, Cumulative TSN Ack in the SHUTDOWN that we send has
> always been incorrect. Additionally, bundling of the SHUTDOWN with the
> COOKIE-ACK was broken by a later commit. This series fixes both of
> these issues.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-04-23  2:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 19:03 [PATCH net 0/2] sctp: Fix problems with peer restart when in SHUTDOWN-PENDING state and socket is closed Jere Leppänen
2020-04-21 19:03 ` [PATCH net 0/2] sctp: Fix problems with peer restart when in SHUTDOWN-PENDING state and socket is cl Jere Leppänen
2020-04-21 19:03 ` [PATCH net 1/2] sctp: Fix bundling of SHUTDOWN with COOKIE-ACK Jere Leppänen
2020-04-21 19:03   ` Jere Leppänen
2020-04-23  1:09   ` Marcelo Ricardo Leitner
2020-04-23  1:09     ` Marcelo Ricardo Leitner
2020-04-21 19:03 ` [PATCH net 2/2] sctp: Fix SHUTDOWN CTSN Ack in the peer restart case Jere Leppänen
2020-04-21 19:03   ` Jere Leppänen
2020-04-23  1:09   ` Marcelo Ricardo Leitner
2020-04-23  1:09     ` Marcelo Ricardo Leitner
2020-04-23  2:28 ` [PATCH net 0/2] sctp: Fix problems with peer restart when in SHUTDOWN-PENDING state and socket is closed David Miller
2020-04-23  2:28   ` [PATCH net 0/2] sctp: Fix problems with peer restart when in SHUTDOWN-PENDING state and socket i David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.