]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/ipv6/udp.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[linux.git] / net / ipv6 / udp.c
index d538fafaf4a921486d7ded2563c7b62ddc97fb6d..2464fba569b4eb39452bd81f94cbe80227368fc9 100644 (file)
@@ -1045,6 +1045,8 @@ static void udp_v6_flush_pending_frames(struct sock *sk)
 static int udpv6_pre_connect(struct sock *sk, struct sockaddr *uaddr,
                             int addr_len)
 {
+       if (addr_len < offsetofend(struct sockaddr, sa_family))
+               return -EINVAL;
        /* The following checks are replicated from __ip6_datagram_connect()
         * and intended to prevent BPF program called below from accessing
         * bytes that are out of the bound specified by user in addr_len.