tipc: Ignore neighbor discovery messages containing invalid address
authorAllan Stephens <allan.stephens@windriver.com>
Fri, 7 Oct 2011 19:48:41 +0000 (15:48 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Tue, 27 Dec 2011 16:33:38 +0000 (11:33 -0500)
Adds a check to ensure that TIPC ignores an incoming neighbor discovery
message that specifies an invalid media address as its source. The check
ensures that the source address is a valid, non-broadcast address that
could legally be used by a neighboring link endpoint.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
net/tipc/discover.c

index 1ea2d44bbc3675257334c3409c60aee95652ba2b..420e0329036b18afe943d32456d1870cd5182ded 100644 (file)
@@ -130,12 +130,15 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr)
        u32 type = msg_type(msg);
        int link_fully_up;
 
+       media_addr.broadcast = 1;
        b_ptr->media->msg2addr(&media_addr, msg_media_addr(msg));
        buf_discard(buf);
 
        /* Validate discovery message from requesting node */
        if (net_id != tipc_net_id)
                return;
+       if (media_addr.broadcast)
+               return;
        if (!tipc_addr_domain_valid(dest))
                return;
        if (!tipc_addr_node_valid(orig))