| From stable-bounces@linux.kernel.org Wed Jul 18 02:44:24 2007 |
| From: Vlad Yasevich <vladislav.yasevich@hp.com> |
| Date: Wed, 18 Jul 2007 02:44:12 -0700 (PDT) |
| Subject: SCTP scope_id handling fix |
| To: stable@kernel.org |
| Cc: bunk@stusta.de |
| Message-ID: <20070718.024412.35506936.davem@davemloft.net> |
| |
| From: Vlad Yasevich <vladislav.yasevich@hp.com> |
| |
| 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: Greg Kroah-Hartman <gregkh@suse.de> |
| |
| --- |
| net/sctp/ipv6.c | 4 ++++ |
| 1 file changed, 4 insertions(+) |
| |
| --- a/net/sctp/ipv6.c |
| +++ b/net/sctp/ipv6.c |
| @@ -875,6 +875,10 @@ static int sctp_inet6_send_verify(struct |
| 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; |