Commit 9bff1948 authored by Vlad Yasevich's avatar Vlad Yasevich Committed by Greg Kroah-Hartman

SCTP scope_id handling fix

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: default avatarVlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 420eb873
...@@ -875,6 +875,10 @@ static int sctp_inet6_send_verify(struct sctp_sock *opt, union sctp_addr *addr) ...@@ -875,6 +875,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); dev = dev_get_by_index(addr->v6.sin6_scope_id);
if (!dev) if (!dev)
return 0; return 0;
if (!ipv6_chk_addr(&addr->v6.sin6_addr, dev, 0)) {
dev_put(dev);
return 0;
}
dev_put(dev); dev_put(dev);
} }
af = opt->pf->af; af = opt->pf->af;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment