Skip to content

Commit

Permalink
SCTP: Add scope_id validation for link-local binds
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vlad Yasevich authored and David S. Miller committed Jul 6, 2007
1 parent f50f95c commit 1669d85
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/sctp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1669d85

Please sign in to comment.