aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2007-07-22 18:24:56 +0200
committerAdrian Bunk <bunk@stusta.de>2007-07-22 18:24:56 +0200
commitc88fee3c266ce5147abf2f4efd9bed4249e122d4 (patch)
tree29a237185148eb45915c6034d25f844f9ae6e012
parentc08c47f63dfeaebb96096f9c1c1b23e4aabc5eed (diff)
SCTP: Add scope_id validation for link-local binds
SCTP currently permits users to bind to link-local addresses, but doesn't verify that the scope id specified at bind matches the interface that the address is configured on. It was report that this can hang a system. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Adrian Bunk <bunk@stusta.de>
-rw-r--r--net/sctp/ipv6.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index c068d53e541..ab1c01a1d0f 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -840,6 +840,10 @@ static int sctp_inet6_send_verify(struct sctp_sock *opt, union sctp_addr *addr)
dev = dev_get_by_index(addr->v6.sin6_scope_id);
if (!dev)
return 0;
+ if (!ipv6_chk_addr(&addr->v6.sin6_addr, dev, 0)) {
+ dev_put(dev);
+ return 0;
+ }
dev_put(dev);
}
af = opt->pf->af;