lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 18 Apr 2007 14:38:15 -0400
From:	Vlad Yasevich <>
To:	David Miller <>
Cc:	"" 
	netdev <>
Subject: [PATCH] [SCTP] Do not interleave non-fragments when in partial delivery

Hi David

This is a bug fix, but done on top of 2.6.22 tree.  I am trying
to minimize the amount of conflict this would cause during merge
by doing it this way.  However, if you would rather keep all the bugfixes
in net-2.6, I can do that too, but that _will_ give you conflicts.


[SCTP] Do not interleave non-fragments when in partial delivery

The way partial delivery is currently implemented, it is possible to
interleave a message (either from another stream, or unordered) that
is not part of partial delivery process.  The only way to this is for
a message to not be a fragment and be 'in order' or unordered for a
given stream.  This will result in bypassing the reassembly/ordering
queues where things live during partial delivery, and the
message will be delivered to the socket in the middle of partial delivery.

This is a two-fold problem, in that:
1.  the app now must check the stream-id and flags which it may not
be doing.
2.  this clears partial delivery state from the association and results
in app communication hanging.

This patch is a band-aid over a much bigger problem in that we
don't do stream interleave.

Signed-off-by: Vlad Yasevich <>
 net/sctp/ulpqueue.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index ae374a9..fb2ec63 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -224,7 +224,14 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sctp_ulpevent *event)
 		queue = &sk->sk_receive_queue;
 	} else {
 		if (ulpq->pd_mode) {
-			if (event->msg_flags & MSG_NOTIFICATION)
+			/* If the association is in partial delivery, we
+			 * need to finish delivering the partially processed
+			 * packet before passing any other data.  This is
+			 * because we don't truly support stream interleaving.
+			 */
+			if ((event->msg_flags & MSG_NOTIFICATION) ||
+			    (SCTP_DATA_NOT_FRAG ==
+				    (event->msg_flags & SCTP_DATA_FRAG_MASK)))
 				queue = &sctp_sk(sk)->pd_lobby;
 			else {
 				clear_pd = event->msg_flags & MSG_EOR;

To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists