linux-stable/net/sctp
Xin Long cd2b708750 sctp: check duplicate node before inserting a new transport
sctp has changed to use rhlist for transport rhashtable since commit
7fda702f93 ("sctp: use new rhlist interface on sctp transport
rhashtable").

But rhltable_insert_key doesn't check the duplicate node when inserting
a node, unlike rhashtable_lookup_insert_key. It may cause duplicate
assoc/transport in rhashtable. like:

 client (addr A, B)                 server (addr X, Y)
    connect to X           INIT (1)
                        ------------>
    connect to Y           INIT (2)
                        ------------>
                         INIT_ACK (1)
                        <------------
                         INIT_ACK (2)
                        <------------

After sending INIT (2), one transport will be created and hashed into
rhashtable. But when receiving INIT_ACK (1) and processing the address
params, another transport will be created and hashed into rhashtable
with the same addr Y and EP as the last transport. This will confuse
the assoc/transport's lookup.

This patch is to fix it by returning err if any duplicate node exists
before inserting it.

Fixes: 7fda702f93 ("sctp: use new rhlist interface on sctp transport rhashtable")
Reported-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-02-19 18:19:37 -05:00
..
associola.c sctp: add dst_pending_confirm flag 2017-02-07 13:07:46 -05:00
auth.c sctp: use IS_ENABLED() instead of checking for built-in or module 2016-09-10 21:19:11 -07:00
bind_addr.c sctp: not copying duplicate addrs to the assoc's bind address list 2016-12-20 14:15:45 -05:00
chunk.c sctp: refactor sctp_datamsg_from_user 2016-12-29 14:44:03 -05:00
debug.c net: sctp: fix array overrun read on sctp_timer_tbl 2017-01-24 15:24:35 -05:00
endpointola.c sctp: add reconf_enable in asoc ep and netns 2017-01-18 14:55:10 -05:00
input.c sctp: check duplicate node before inserting a new transport 2017-02-19 18:19:37 -05:00
inqueue.c sctp: rename WORD_TRUNC/ROUND macros 2016-09-22 03:13:26 -04:00
ipv6.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-01-28 10:33:06 -05:00
Kconfig sctp: add the sctp_diag.c file 2016-04-15 17:29:36 -04:00
Makefile sctp: prepare asoc stream for stream reconf 2017-01-06 21:07:26 -05:00
objcnt.c sctp: prepare asoc stream for stream reconf 2017-01-06 21:07:26 -05:00
offload.c sctp: sctp gso should set feature with NETIF_F_SG when calling skb_segment 2017-01-25 12:28:33 -05:00
output.c sctp: add dst_pending_confirm flag 2017-02-07 13:07:46 -05:00
outqueue.c sctp: add dst_pending_confirm flag 2017-02-07 13:07:46 -05:00
primitive.c sctp: add stream reconf primitive 2017-01-18 14:55:10 -05:00
probe.c
proc.c net: Suppress the "Comparison to NULL could be written" warnings 2016-09-30 01:50:45 -04:00
protocol.c sctp: add reconf_enable in asoc ep and netns 2017-01-18 14:55:10 -05:00
sctp_diag.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-10-02 22:20:41 -04:00
sm_make_chunk.c sctp: add a function to verify the sctp reconf chunk 2017-02-19 18:17:59 -05:00
sm_sideeffect.c sctp: add dst_pending_confirm flag 2017-02-07 13:07:46 -05:00
sm_statefuns.c sctp: add reconf chunk process 2017-02-19 18:17:59 -05:00
sm_statetable.c sctp: add reconf chunk event 2017-02-19 18:17:59 -05:00
socket.c sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter 2017-02-09 16:57:38 -05:00
stream.c sctp: implement receiver-side procedures for the Incoming SSN Reset Request Parameter 2017-02-19 18:17:59 -05:00
sysctl.c
transport.c sctp: add dst_pending_confirm flag 2017-02-07 13:07:46 -05:00
tsnmap.c
ulpevent.c sctp: add support for generating stream ssn reset event notification 2017-02-19 18:17:59 -05:00
ulpqueue.c sctp: prepare asoc stream for stream reconf 2017-01-06 21:07:26 -05:00