diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-07-03 20:29:23 +0200 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-06 02:40:15 +0200 |
commit | 1669d857a25d62c6d0a6d9216e01c21287a7c844 (patch) | |
tree | dfe9ae301c96947e7bde1c9a69b5d0b376901ebb /net | |
parent | SCTP: Check to make sure file is valid before setting timeout (diff) | |
download | linux-1669d857a25d62c6d0a6d9216e01c21287a7c844.tar.xz linux-1669d857a25d62c6d0a6d9216e01c21287a7c844.zip |
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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sctp/ipv6.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 84cd53635fe8..2c29394fd92e 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c @@ -844,6 +844,10 @@ static int sctp_inet6_bind_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; |