aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/mcast.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@openvz.org>2007-02-06 17:35:25 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-08 15:39:04 -0500
commitcc63f70b8b410eb653449151821f6b8b9af6ca42 (patch)
treeb78fb82523f1ed05c6e0a3547021ba213aa2d3b6 /net/ipv6/mcast.c
parentf2f2102d1a1dbc83b5b37b6596cd8374120cbe16 (diff)
[IPV4/IPV6] multicast: Check add_grhead() return value
add_grhead() allocates memory with GFP_ATOMIC and in at least two places skb from it passed to skb_put() without checking. Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r--net/ipv6/mcast.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 882cde4b4047..e3ec21695832 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1582,6 +1582,8 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
1582 skb = add_grhead(skb, pmc, type, &pgr); 1582 skb = add_grhead(skb, pmc, type, &pgr);
1583 first = 0; 1583 first = 0;
1584 } 1584 }
1585 if (!skb)
1586 return NULL;
1585 psrc = (struct in6_addr *)skb_put(skb, sizeof(*psrc)); 1587 psrc = (struct in6_addr *)skb_put(skb, sizeof(*psrc));
1586 *psrc = psf->sf_addr; 1588 *psrc = psf->sf_addr;
1587 scount++; stotal++; 1589 scount++; stotal++;