linux/net/sctp
Vlad Yasevich ce8c50393d sctp: handle association restarts when the socket is closed.
[ Upstream commit bdf6fa52f0 ]

Currently association restarts do not take into consideration the
state of the socket.  When a restart happens, the current assocation
simply transitions into established state.  This creates a condition
where a remote system, through a the restart procedure, may create a
local association that is no way reachable by user.  The conditions
to trigger this are as follows:
  1) Remote does not acknoledge some data causing data to remain
     outstanding.
  2) Local application calls close() on the socket.  Since data
     is still outstanding, the association is placed in SHUTDOWN_PENDING
     state.  However, the socket is closed.
  3) The remote tries to create a new association, triggering a restart
     on the local system.  The association moves from SHUTDOWN_PENDING
     to ESTABLISHED.  At this point, it is no longer reachable by
     any socket on the local system.

This patch addresses the above situation by moving the newly ESTABLISHED
association into SHUTDOWN-SENT state and bundling a SHUTDOWN after
the COOKIE-ACK chunk.  This way, the restarted associate immidiately
enters the shutdown procedure and forces the termination of the
unreachable association.

Reported-by: David Laight <David.Laight@aculab.com>
Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-15 08:36:42 +02:00
..
Kconfig
Makefile
associola.c net: sctp: inherit auth_capable on INIT collisions 2014-08-14 09:38:24 +08:00
auth.c net: sctp: cache auth_enable per endpoint 2014-05-31 13:20:34 -07:00
bind_addr.c
chunk.c sctp: fix checkpatch errors with space required or prohibited 2013-12-26 13:47:47 -05:00
command.c
debug.c
endpointola.c net: sctp: cache auth_enable per endpoint 2014-05-31 13:20:34 -07:00
input.c sctp: remove macros sctp_bh_[un]lock_sock 2014-01-21 18:41:36 -08:00
inqueue.c
ipv6.c net: sctp: fix initialization of local source address on accepted ipv6 sockets 2014-02-06 21:18:06 -08:00
objcnt.c sctp: fix checkpatch errors with (foo*)|foo * bar|foo* bar 2013-12-26 13:47:47 -05:00
output.c sctp: fix possible seqlock seadlock in sctp_packet_transmit() 2014-08-14 09:38:24 +08:00
outqueue.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-01-06 17:37:45 -05:00
primitive.c
probe.c
proc.c sctp: remove macros sctp_local_bh_{disable|enable} 2014-01-21 18:40:40 -08:00
protocol.c sctp: reset flowi4_oif parameter on route lookup 2014-05-31 13:20:35 -07:00
sm_make_chunk.c net: sctp: cache auth_enable per endpoint 2014-05-31 13:20:34 -07:00
sm_sideeffect.c net: sctp: Don't transition to PF state when transport has exhausted 'Path.Max.Retrans'. 2014-05-31 13:20:36 -07:00
sm_statefuns.c sctp: handle association restarts when the socket is closed. 2014-10-15 08:36:42 +02:00
sm_statetable.c sctp: fix checkpatch errors with indent 2013-12-26 13:47:48 -05:00
socket.c net: sctp: cache auth_enable per endpoint 2014-05-31 13:20:34 -07:00
ssnmap.c
sysctl.c net: sctp: check proc_dointvec result in proc_sctp_do_auth 2014-07-28 08:05:59 -07:00
transport.c
tsnmap.c
ulpevent.c net: sctp: fix information leaks in ulpevent layer 2014-07-28 08:06:01 -07:00
ulpqueue.c sctp: fix checkpatch errors with open brace '{' and trailing statements 2013-12-26 13:47:48 -05:00