diff options
author | Alexey Dobriyan <adobriyan@openvz.org> | 2007-02-06 14:35:25 -0800 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-02-08 12:39:04 -0800 |
commit | cc63f70b8b410eb653449151821f6b8b9af6ca42 (patch) | |
tree | b78fb82523f1ed05c6e0a3547021ba213aa2d3b6 /net/ipv6/mcast.c | |
parent | f2f2102d1a1dbc83b5b37b6596cd8374120cbe16 (diff) | |
download | linux-3.10-cc63f70b8b410eb653449151821f6b8b9af6ca42.tar.gz linux-3.10-cc63f70b8b410eb653449151821f6b8b9af6ca42.tar.bz2 linux-3.10-cc63f70b8b410eb653449151821f6b8b9af6ca42.zip |
[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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 882cde4b404..e3ec2169583 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, skb = add_grhead(skb, pmc, type, &pgr); first = 0; } + if (!skb) + return NULL; psrc = (struct in6_addr *)skb_put(skb, sizeof(*psrc)); *psrc = psf->sf_addr; scount++; stotal++; |