ipv6: sctp: clone options to avoid use after free
authorEric Dumazet <edumazet@google.com>
Wed, 9 Dec 2015 15:25:06 +0000 (07:25 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 12 Dec 2015 01:18:40 +0000 (20:18 -0500)
commit9470e24f35ab81574da54e69df90c1eb4a96b43f
treef1ddb2ca0d9eb735f1fb9dbafc238b0d8f83b543
parentd188ba86dd07a72ebebfa22fe9cb0b0572e57740
ipv6: sctp: clone options to avoid use after free

SCTP is lacking proper np->opt cloning at accept() time.

TCP and DCCP use ipv6_dup_options() helper, do the same
in SCTP.

We might later factorize this code in a common helper to avoid
future mistakes.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/ipv6.c