netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] sctp: partial chunk should be drop without sending abort packet
@ 2015-08-24 10:08 Xin Long
  2015-08-24 12:47 ` Marcelo Ricardo Leitner
  2015-08-24 18:01 ` Vlad Yasevich
  0 siblings, 2 replies; 5+ messages in thread
From: Xin Long @ 2015-08-24 10:08 UTC (permalink / raw)
  To: network dev; +Cc: mleitner, davem

as RFC 4960, 6.10 said, *if the receiver detects a partial chunk, it MUST drop
the chunk*, we should not send the abort. but if we put this discard to inside
state machine, it will send abort.

so we just drop the partial chunk there, never let this chunk go into the state
machine.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sctp/inqueue.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/sctp/inqueue.c b/net/sctp/inqueue.c
index 7e8a16c..a22ca57 100644
--- a/net/sctp/inqueue.c
+++ b/net/sctp/inqueue.c
@@ -183,9 +183,9 @@ struct sctp_chunk *sctp_inq_pop(struct sctp_inq *queue)
 		/* This is not a singleton */
 		chunk->singleton = 0;
 	} else if (chunk->chunk_end > skb_tail_pointer(chunk->skb)) {
-		/* Discard inside state machine. */
-		chunk->pdiscard = 1;
-		chunk->chunk_end = skb_tail_pointer(chunk->skb);
+		sctp_chunk_free(chunk);
+		chunk = queue->in_progress = NULL;
+		return NULL;
 	} else {
 		/* We are at the end of the packet, so mark the chunk
 		 * in case we need to send a SACK.
-- 
2.1.0

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

* Re: [PATCH net] sctp: partial chunk should be drop without sending abort packet
  2015-08-24 10:08 [PATCH net] sctp: partial chunk should be drop without sending abort packet Xin Long
@ 2015-08-24 12:47 ` Marcelo Ricardo Leitner
  2015-08-24 18:22   ` Daniel Borkmann
  2015-08-24 18:01 ` Vlad Yasevich
  1 sibling, 1 reply; 5+ messages in thread
From: Marcelo Ricardo Leitner @ 2015-08-24 12:47 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, davem

On Mon, Aug 24, 2015 at 06:08:30PM +0800, Xin Long wrote:
> as RFC 4960, 6.10 said, *if the receiver detects a partial chunk, it MUST drop
> the chunk*, we should not send the abort. but if we put this discard to inside
> state machine, it will send abort.
> 
> so we just drop the partial chunk there, never let this chunk go into the state
> machine.
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---

This is basically reverting a chunk of Daniel's and Vlad's 26b87c788100
("net: sctp: fix remote memory pressure from excessive queueing") .
Isn't it going to re-introduce the initial issue then?


>  net/sctp/inqueue.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/sctp/inqueue.c b/net/sctp/inqueue.c
> index 7e8a16c..a22ca57 100644
> --- a/net/sctp/inqueue.c
> +++ b/net/sctp/inqueue.c
> @@ -183,9 +183,9 @@ struct sctp_chunk *sctp_inq_pop(struct sctp_inq *queue)
>  		/* This is not a singleton */
>  		chunk->singleton = 0;
>  	} else if (chunk->chunk_end > skb_tail_pointer(chunk->skb)) {
> -		/* Discard inside state machine. */
> -		chunk->pdiscard = 1;
> -		chunk->chunk_end = skb_tail_pointer(chunk->skb);
> +		sctp_chunk_free(chunk);
> +		chunk = queue->in_progress = NULL;
> +		return NULL;
>  	} else {
>  		/* We are at the end of the packet, so mark the chunk
>  		 * in case we need to send a SACK.
> -- 
> 2.1.0
> 

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

* Re: [PATCH net] sctp: partial chunk should be drop without sending abort packet
  2015-08-24 10:08 [PATCH net] sctp: partial chunk should be drop without sending abort packet Xin Long
  2015-08-24 12:47 ` Marcelo Ricardo Leitner
@ 2015-08-24 18:01 ` Vlad Yasevich
  2015-08-27 13:41   ` lucien xin
  1 sibling, 1 reply; 5+ messages in thread
From: Vlad Yasevich @ 2015-08-24 18:01 UTC (permalink / raw)
  To: Xin Long, network dev; +Cc: mleitner, davem

On 08/24/2015 06:08 AM, Xin Long wrote:
> as RFC 4960, 6.10 said, *if the receiver detects a partial chunk, it MUST drop
> the chunk*, we should not send the abort. but if we put this discard to inside
> state machine, it will send abort.
> 

Actually, silently dropping this is _very_ bad.  There reason is that you've already
processed the leading chunks and may have potentially queued a response...  Now, you
reach the end of the packet and find that the last chunk is partial.  You end up
dropping the packet, but still handing the responses.  This actually lead to some very
interesting issues we were seeing.

It is better to terminate the association in this case.

-vlad

> so we just drop the partial chunk there, never let this chunk go into the state
> machine.
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
>  net/sctp/inqueue.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/sctp/inqueue.c b/net/sctp/inqueue.c
> index 7e8a16c..a22ca57 100644
> --- a/net/sctp/inqueue.c
> +++ b/net/sctp/inqueue.c
> @@ -183,9 +183,9 @@ struct sctp_chunk *sctp_inq_pop(struct sctp_inq *queue)
>  		/* This is not a singleton */
>  		chunk->singleton = 0;
>  	} else if (chunk->chunk_end > skb_tail_pointer(chunk->skb)) {
> -		/* Discard inside state machine. */
> -		chunk->pdiscard = 1;
> -		chunk->chunk_end = skb_tail_pointer(chunk->skb);
> +		sctp_chunk_free(chunk);
> +		chunk = queue->in_progress = NULL;
> +		return NULL;
>  	} else {
>  		/* We are at the end of the packet, so mark the chunk
>  		 * in case we need to send a SACK.
> 

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

* Re: [PATCH net] sctp: partial chunk should be drop without sending abort packet
  2015-08-24 12:47 ` Marcelo Ricardo Leitner
@ 2015-08-24 18:22   ` Daniel Borkmann
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Borkmann @ 2015-08-24 18:22 UTC (permalink / raw)
  To: Marcelo Ricardo Leitner, Xin Long; +Cc: network dev, davem

On 08/24/2015 02:47 PM, Marcelo Ricardo Leitner wrote:
> On Mon, Aug 24, 2015 at 06:08:30PM +0800, Xin Long wrote:
>> as RFC 4960, 6.10 said, *if the receiver detects a partial chunk, it MUST drop
>> the chunk*, we should not send the abort. but if we put this discard to inside
>> state machine, it will send abort.
>>
>> so we just drop the partial chunk there, never let this chunk go into the state
>> machine.
>>
>> Signed-off-by: Xin Long <lucien.xin@gmail.com>
>> ---
>
> This is basically reverting a chunk of Daniel's and Vlad's 26b87c788100
> ("net: sctp: fix remote memory pressure from excessive queueing") .
> Isn't it going to re-introduce the initial issue then?

Yes, seems so.

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

* Re: [PATCH net] sctp: partial chunk should be drop without sending abort packet
  2015-08-24 18:01 ` Vlad Yasevich
@ 2015-08-27 13:41   ` lucien xin
  0 siblings, 0 replies; 5+ messages in thread
From: lucien xin @ 2015-08-27 13:41 UTC (permalink / raw)
  To: Vlad Yasevich; +Cc: network dev, Marcelo Ricardo Leitner, davem

>
> Actually, silently dropping this is _very_ bad.  There reason is that you've already
> processed the leading chunks and may have potentially queued a response...  Now, you
> reach the end of the packet and find that the last chunk is partial.  You end up
> dropping the packet, but still handing the responses.  This actually lead to some very
> interesting issues we were seeing.
>
> It is better to terminate the association in this case.
>
> -vlad
>

make sense, I just cannot ensure we are doing this as RFC, after all,
it doesnot say
we should send abort in this case clearly.

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

end of thread, other threads:[~2015-08-27 13:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-24 10:08 [PATCH net] sctp: partial chunk should be drop without sending abort packet Xin Long
2015-08-24 12:47 ` Marcelo Ricardo Leitner
2015-08-24 18:22   ` Daniel Borkmann
2015-08-24 18:01 ` Vlad Yasevich
2015-08-27 13:41   ` lucien xin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).