From: Vlad Yasevich Date: Wed, 18 Jul 2007 09:44:12 +0000 (-0700) Subject: [PATCH] SCTP scope_id handling fix X-Git-Tag: v2.6.20.17~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=844aa7759d867d26c4a63610c0da2354e235d80a;p=thirdparty%2Fkernel%2Fstable.git [PATCH] 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: Vlad Yasevich Signed-off-by: Greg Kroah-Hartman Signed-off-by: Willy Tarreau --- diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index ef36be073a139..c00c73c39749c 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c @@ -874,6 +874,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;