linux/net
Neil Horman d8dd15781d sctp: Fix mis-ordering of user space data when multihoming in use
Recently had a bug reported to me, in which the user was sending
packets with a payload containing a sequence number.  The packets
were getting delivered in order according the chunk TSN values, but
the sequence values in the payload were arriving out of order.  At
first I thought it must be an application error, but we eventually
found it to be a problem on the transmit side in the sctp stack.

The conditions for the error are that multihoming must be in use,
and it helps if each transport has a different pmtu.  The problem
occurs in sctp_outq_flush.  Basically we dequeue packets from the
data queue, and attempt to append them to the orrered packet for a
given transport.  After we append a data chunk we add the trasport
to the end of a list of transports to have their packets sent at
the end of sctp_outq_flush.  The problem occurs when a data chunks
fills up a offered packet on a transport.  The function that does
the appending (sctp_packet_transmit_chunk), will try to call
sctp_packet_transmit on the full packet, and then append the chunk
to a new packet.  This call to sctp_packet_transmit, sends that
packet ahead of the others that may be queued in the transport_list
in sctp_outq_flush.  The result is that frames that were sent in one
order from the user space sending application get re-ordered prior
to tsn assignment in sctp_packet_transmit, resulting in mis-sequencing
of data payloads, even though tsn ordering is correct.

The fix is to change where we assign a tsn.  By doing this earlier,
we are then free to place chunks in packets, whatever way we
see fit and the protocol will make sure to do all the appropriate
re-ordering on receive as is needed.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: William Reich <reich@ulticom.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
2009-11-23 15:54:00 -05:00
..
9p
802
8021q Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-11-18 22:19:03 -08:00
appletalk net/appletalk: using compat_ptr needs inclusion of linux/compat.h 2009-11-08 20:41:03 -08:00
atm net/atm: move all compat_ioctl handling to atm/ioctl.c 2009-11-11 19:22:23 -08:00
ax25
bluetooth Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-11-17 00:05:02 -08:00
bridge
can CAN: use dev_get_by_index_rcu 2009-11-10 22:27:13 -08:00
core net: Fix missing kernel-doc notation 2009-11-22 20:43:13 -08:00
dcb
dccp
decnet decnet: convert dndev_lock to spinlock 2009-11-11 19:22:18 -08:00
dsa
econet
ethernet remove deprecated and not used: print_mac() 2009-11-15 22:21:34 -08:00
ieee802154 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan 2009-11-14 20:24:30 -08:00
ipv4 net/ipv4: Move && and || to end of previous line 2009-11-23 10:41:23 -08:00
ipv6 netns: net_identifiers should be read_mostly 2009-11-18 05:03:25 -08:00
ipx
irda Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-11-18 22:19:03 -08:00
iucv iucv: add work_queue cleanup for suspend 2009-11-13 20:46:58 -08:00
key netns: net_identifiers should be read_mostly 2009-11-18 05:03:25 -08:00
lapb
llc
mac80211 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-11-18 22:19:03 -08:00
netfilter Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-11-18 22:19:03 -08:00
netlabel net: rename skb->iif to skb->skb_iif 2009-11-20 15:35:04 -08:00
netlink netlink: remove subscriptions check on notifier 2009-11-17 04:08:49 -08:00
netrom
packet net: netlink_getname, packet_getname -- use DECLARE_SOCKADDR guard 2009-11-10 20:54:41 -08:00
phonet Phonet: convert devices list to RCU 2009-11-18 10:08:26 -08:00
rds
rfkill
rose
rxrpc
sched net: rename skb->iif to skb->skb_iif 2009-11-20 15:35:04 -08:00
sctp sctp: Fix mis-ordering of user space data when multihoming in use 2009-11-23 15:54:00 -05:00
sunrpc Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-11-18 22:19:03 -08:00
tipc
unix net: netlink_getname, packet_getname -- use DECLARE_SOCKADDR guard 2009-11-10 20:54:41 -08:00
wanrouter
wimax
wireless Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-11-18 22:19:03 -08:00
x25 X25: Enable setting of cause and diagnostic fields 2009-11-18 23:30:41 -08:00
xfrm xfrm: SAD entries do not expire correctly after suspend-resume 2009-11-08 20:58:41 -08:00
compat.c
Kconfig
Makefile
nonet.c
socket.c net/atm: move all compat_ioctl handling to atm/ioctl.c 2009-11-11 19:22:23 -08:00
sysctl_net.c
TUNABLE