]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
SCTP: Add scope_id validation for link-local binds
authorVlad Yasevich <vladislav.yasevich@hp.com>
Sun, 22 Jul 2007 16:24:56 +0000 (18:24 +0200)
committerAdrian Bunk <bunk@stusta.de>
Sun, 22 Jul 2007 16:24:56 +0000 (18:24 +0200)
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: Adrian Bunk <bunk@stusta.de>
net/sctp/ipv6.c

index c068d53e5415859f4e2ff2636cd765b7ff1042d6..ab1c01a1d0f91fe548ee4e3ea440ec4d0b7eb5b3 100644 (file)
@@ -840,6 +840,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;